Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Storing changing data within a script after the __DATA__ tokenby jynx (Priest) |
on May 09, 2002 at 19:47 UTC ( [id://165478]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Meditations
|
|