Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: while loop over filehandle

by kabel (Chaplain)
on Sep 23, 2002 at 08:42 UTC ( [id://200045]=note: print w/replies, xml ) Need Help??


in reply to while loop over filehandle

you do not need to explicitly count the line where you are. the variable $. holds the current input line:
open (FH, $file) or die "$file: $!"; # need to do it once to initialize $. push @content, scalar (<FH>); while ($. < LINE_COUNT) { push @content, scalar (<FH>); } close (FH);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 03:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found