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

Re^3: Can you read a false value from a file?

by converter (Priest)
on Feb 11, 2006 at 10:06 UTC ( #529544=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Can you read a false value from a file?
in thread Can you read a false value from a file?

When you write while ($scalar = <FILEHANDLE>) { ... }, perl takes care of the test for definedness for you:

$ perl -MO=Deparse -e 'open $fh,"foo.txt"; while (my $line = <$fh>) { +print $line }' open $fh, 'foo.txt'; while (defined(my $line = <$fh>)) { print $line; } -e syntax OK


Comment on Re^3: Can you read a false value from a file?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2014-10-02 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (52 votes), past polls