Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: File Reading and Closing confusion

by repellent (Priest)
on Aug 08, 2010 at 23:31 UTC ( #853685=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        while (defined($_ = <FH>)) { ... }
    
  2. or download this
    my @lines = do { open my $fh, '<', $file or die "$file: $!\n"; <$fh> };
  3. or download this
    my @lines = do { local @ARGV = $file; <> };
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://853685]
help
Chatterbox?
[usemodperl]: definitely

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2018-06-24 17:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (126 votes). Check out past polls.

    Notices?