Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Fastest way of changing the beginning of a txt file..

by pwagyi (Monk)
on Feb 19, 2019 at 03:21 UTC ( [id://1230131]=note: print w/replies, xml ) Need Help??


in reply to Fastest way of changing the beginning of a txt file..

You can try Tie::File (https://perldoc.perl.org/Tie/File.html)

The file is not loaded into memory, so this will work even for giganti +c files. Changes to the array are reflected in the file immediately.

Replies are listed 'Best First'.
Re^2: Fastest way of changing the beginning of a txt file..
by haukex (Archbishop) on Feb 19, 2019 at 18:15 UTC
    You can try Tie::File

    Unfortunately, Tie::File adds significant overhead, so it's pretty safe to assume that it would slow things down and burn more memory.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-20 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found