Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Is there a problem with using barewords as filehandles ?

by Discipulus (Canon)
on Jul 01, 2020 at 10:19 UTC ( [id://11118756]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -we "use strict; open FH, '>', 'text.txt'; open FH, '>', 'text.tx
    +t';"
    
    perl -we "use strict; open my $fh, '>', 'text.txt'; open my $fh, '>', 
    +'text.txt';"
    "my" variable $fh masks earlier declaration in same scope at -e line 1
    +.
    
  2. or download this
    use strict;
    
    ...
    open FH, '<', 'filename'; # now ok
    open my $fh, 'filename';  # now ok
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11118756]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-29 12:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found