Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Reading a File by Line then Analyzing each Line

by japhy (Canon)
on Jun 06, 2006 at 16:36 UTC ( [id://553861]=note: print w/replies, xml ) Need Help??


in reply to Reading a File by Line then Analyzing each Line

I'll answer the latter half of your node later (it's time for lunch), but let me just say that your file-opening-and-reading code is really cumbersome. It's so much easier just to do:
open my($fh), "<", "/path/to/file" or die "can't read /path/to/file: $ +!"; while (my $line = <$fh>) { # do stuff with $line } close $fh;
As for line analysis, I'll write something after I've eaten (but I'll be too late, since I'm sure some other monks will give you sound advice).

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-04-23 11:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found