Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by jynx (Priest)
on May 09, 2002 at 19:47 UTC ( #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
Node Status?
node history
Node Type: note [id://165478]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2016-07-25 22:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (229 votes). Check out past polls.