Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
laziness, impatience, and hubris
 
PerlMonks  

Re: Appending to a file.

by Corion (Pope)
on May 07, 2012 at 15:45 UTC ( #969284=note: print w/ replies, xml ) Need Help??


in reply to Appending to a file.

Take a look at the following options:

Tie::File, which lets you treat a file just like an array.

perlvar on $^I for how to make Perl edit a file in-place.


Comment on Re: Appending to a file.
Download Code
Re^2: Appending to a file.
by xavierarmadillo (Initiate) on May 07, 2012 at 16:00 UTC
    Reading about the tie:file makes some sense. It looks like the array addresses the memory location of the file and it works the same as an array. I don't have any clue what push, new recs...., pop, unshift, shift, or splice do.

      Mitigating cluelessness.
      That's what Perl's documentation is there for.

      • push
      • "new recs"? Perhaps you'd better re-read what puzzled you in the first place so you can quote it accurately.
      • pop
      • unshift
      • shift
      • ...and for splice... try Super Search with splice as your argument... or read a primer such as "Learning Perl."

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2013-05-23 22:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (493 votes), past polls