Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 contemplating the Monastery: (6)
As of 2015-08-30 14:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (349 votes), past polls