Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Deleting a line out of text file

by crouchingpenguin (Priest)
on Aug 14, 2003 at 02:38 UTC ( #283748=note: print w/replies, xml ) Need Help??


in reply to Re: Deleting a line out of text file
in thread Deleting a line out of text file

...you cannot just edit a file in place...

This has been coming up a lot recently. See Tie::File:

"Tie::File" represents a regular text file as a Perl array. Each element in the array corresponds to a record in the file. The first line of the file is element 0 of the array; the second line is element 1, and so on. The file is not loaded into memory, so this will work even for gigantic files. Changes to the array are reflected in the file immediately.

For an example of changing a file in place using Tie::File, see this node and this node.


cp
----
"Never be afraid to try something new. Remember, amateurs built the ark. Professionals built the Titanic."
  • Comment on Re: Re: Deleting a line out of text file

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://283748]
help
Chatterbox?
[moritz]: depends on what you mean by "most stuff"
[1nickt]: I am sure I don't know about most of the stuff that is no longer controlled by humans. I do know that it's past the point of determining consumer pricing and into things that can kill me with blunt force!
[holli]: but is this really a problem 1nickt? Nobody knows how your human taxi drivers brain works either
[holli]: at least for cars, if the ai works better than a human on average, by all means let the machines drive

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2017-11-21 13:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (301 votes). Check out past polls.

    Notices?