Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: What is the best way to remove(delete) specific lines from a very large file?

by abhishek_akj (Initiate)
on Aug 26, 2009 at 10:12 UTC ( #791299=note: print w/replies, xml ) Need Help??


in reply to What is the best way to remove(delete) specific lines from a very large file?

use Tie::File; tie @array, 'Tie::File', "filename" or die "something is wrong: $! \n" +;
But dont try to use scalar @file or something which tries to calculate the size of @array, as that will start loading the whole array in memory . moreover dont use foreach to traverse this array, as that internally calculates the size of array before traversing it, use while instead
  • Comment on Re: What is the best way to remove(delete) specific lines from a very large file?
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2021-05-07 13:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (91 votes). Check out past polls.

    Notices?