Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How does while works with filehandles?

by tobyink (Abbot)
on Dec 02, 2012 at 19:22 UTC ( #1006749=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ echo -n "0" | perl -E'while(<>) { say "GOT" }'
    GOT
    $ echo -n "0" | perl -E'while(<> and 1) { say "GOT" }'
    $ 
    
  2. or download this
    $ echo "Hello" | perl -E'while(<>){ print $_ }'
    Hello
    $ echo "Hello" | perl -E'<>; print $_'
    $
    
  3. or download this
    while (defined($_ = <$fh>))
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-09-22 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (182 votes), past polls