summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>1999-05-07 21:24:50 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>1999-05-07 21:24:50 +0000
commit853846ea710f8feaed8c98b358bdc8967dd522d2 (patch)
treeb897c99fba920636ba7e2d962c8cf67880fd40d6 /op.c
parent7c1e0849686a4ea069f6fa2a095a70c337e62ace (diff)
downloadperl-853846ea710f8feaed8c98b358bdc8967dd522d2.tar.gz
Implement open( my $fh, ...) and similar.
Set flag in op.c for "constructor ops" In pp_rv2gv, if flag is set and arg is PADSV and uninit vivify as reference to a detached GV. (Name of GV is the pad name.) This scheme should "just work" for pipe/socket etc. too. #if 0 out the open(FH,undef) for now. Change t/io/open.t to test open(my $fh,...) p4raw-id: //depot/perl@3326
Diffstat (limited to 'op.c')
-rw-r--r--op.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/op.c b/op.c
index 2b6107e729..5e2d593225 100644
--- a/op.c
+++ b/op.c
@@ -4780,11 +4780,20 @@ ck_fun(OP *o)
}
else {
I32 flags = OPf_SPECIAL;
+ I32 private = 0;
/* is this op a FH constructor? */
- if (is_handle_constructor(o,numargs))
- flags = 0;
+ if (is_handle_constructor(o,numargs)) {
+ /* Set a flag to tell rv2gv to vivify
+ * need to "prove" flag does not mean something
+ * else already - NI-S 1999/05/07
+ */
+ flags = 0;
+ private = OPpDEREF;
+ }
kid->op_sibling = 0;
kid = newUNOP(OP_RV2GV, flags, scalar(kid));
+ if (private)
+ kid->op_private |= private;
}
kid->op_sibling = sibl;
*tokid = kid;