Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Storing changing data within a script after the __DATA__ token

by jynx (Priest)
on May 09, 2002 at 19:47 UTC ( [id://165478]=note: print w/replies, xml ) Need Help??


in reply to Storing changing data within a script after the __DATA__ token


shamless plug: a different way to do it

That's probably not the way you want to do it at all, but it works, if nothing else. What i did was: read the file into an array, pop off the lines from the end until i found the __END__ token, write over the original file (look at the c subroutine in the spoiler for the code). Since i had already read the data after the __END__ token before i wasn't missing anything, but one could also store the data while popping it off the array.

There are numerous ways to do it, and this is provided as a mere example of that. But really, i would suggest going with TheDamien's (and TheBrian's) module over this method for many reasons (most notably of which is maintainability).

jynx

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found