From: Gurusamy Sarathy Date: Mon, 20 Mar 2000 22:14:35 +0000 (+0000) Subject: add note about symbolic filehandles (from Johan Vromans) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d6fd2b02d50b0bf989dc521c19ed6e9f2fbfb325;p=p5sagit%2Fp5-mst-13.2.git add note about symbolic filehandles (from Johan Vromans) p4raw-id: //depot/perl@5843 --- diff --git a/lib/strict.pm b/lib/strict.pm index f9d60af..042227f 100644 --- a/lib/strict.pm +++ b/lib/strict.pm @@ -34,6 +34,8 @@ use symbolic references (see L). print $$ref; # ok $ref = "foo"; print $$ref; # runtime error; normally ok + $file = "STDOUT"; + print $file "Hi!"; # error; note: no comma after $file =item C diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 2c96d1d..5396fd1 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2587,7 +2587,10 @@ conversion assumes base 10.) Opens the file whose filename is given by EXPR, and associates it with FILEHANDLE. If FILEHANDLE is an expression, its value is used as the -name of the real filehandle wanted. If EXPR is omitted, the scalar +name of the real filehandle wanted. (This is considered a symbolic +reference, so C should I be in effect.) + +If EXPR is omitted, the scalar variable of the same name as the FILEHANDLE contains the filename. (Note that lexical variables--those declared with C--will not work for this purpose; so if you're using C, specify EXPR in your call