develooper Front page | perl.perl5.porters | Postings from March 2000

PATCH: More documentation for filehandle name / use strict clash

From:
Johan Vromans
Date:
March 20, 2000 11:22
Subject:
PATCH: More documentation for filehandle name / use strict clash
Message ID:
14550.31283.410189.587417@phoenix.squirrel.nl
--- perl-5.6.0-bleeding/pod/perlfunc.pod	Sun Mar 19 16:59:49 2000
+++ pod/perlfunc.pod	Mon Mar 20 20:15:33 2000
@@ -2587,7 +2587,9 @@
 
 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<use strict 'refs'> may I<not> 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<my>--will not work
 for this purpose; so if you're using C<my>, specify EXPR in your call
--- perl-5.6.0-bleeding/lib/strict.pm	Sun Jan 23 12:44:17 2000
+++ strict.pm	Mon Mar 20 20:13:06 2000
@@ -34,6 +34,8 @@
     print $$ref;	# ok
     $ref = "foo";
     print $$ref;	# runtime error; normally ok
+    $file = "STDOUT";
+    print $file "Hi!";	# error; note: no comma after $file
 
 =item C<strict vars>
 
End of Patch



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About