Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 browsing the Monastery: (6)
As of 2015-07-05 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls