Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Loading a part of the file to array using Tie::File

by glasswalk3r (Friar)
on Nov 21, 2017 at 15:00 UTC ( [id://1203890]=note: print w/replies, xml ) Need Help??


in reply to Loading a part of the file to array using Tie::File

Never tried to use Tie::File myself, but AFAIK it is just convenience.

On the other hand, there are plenty of solutions for reading large files. The most simply of it is to rely on open and a while, like:

my $large_file = '/tmp/some_large_file.txt'; open(my $in, '<', $large_file) or die "Cannot read $large_file: $!"; while (<$in>) { # do something with $_ } # close is optional once $in goes out of scope close($in)
Alceu Rodrigues de Freitas Junior
---------------------------------
"You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-16 16:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found