Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://529544]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2016-12-08 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (139 votes). Check out past polls.