Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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?
[ambrus]: My boss wants to generate output data that is impossible to compute from the inputs we have. And I'm trying to convince him that he shouldn't do that.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2017-12-12 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (332 votes). Check out past polls.

    Notices?