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

Re: About text file parsing

by stevieb (Canon)
on Aug 29, 2018 at 14:36 UTC ( #1221306=note: print w/replies, xml ) Need Help??


in reply to About text file parsing

Although I really like Discipulus's approach to parallel processing the file, I thought I'd throw out Tie::File as an option. I've used it a couple of times successfully years ago. It doesn't load the entire file at once; instead, it reads it in chunks and presents the file as an array.

Instead of doing:

while (<$fh>){ ... }

You'd do something like the following after opening the file with the distribution:

for (@fh){ ... }

Replies are listed 'Best First'.
Re^2: About text file parsing
by haukex (Bishop) on Aug 30, 2018 at 21:53 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2020-12-03 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (49 votes). Check out past polls.

    Notices?