Okay, I have a very simple script that needs to keep track of a counter between runs (the only piece of persistent information). I thought it might be simple to just store this counter after __DATA__, instead of creating an entire config file to hold one number. That leads to my questions.

First, is this logic okay? Any big reasons I shouldn't do this?

Second, HOW do I do this? I'm guessing I somehow need to activate inplace editing or something similar, then use something like s/^Document_Number:(\d+)$/$1 + 1/e. Do I need to reopen DATA differently first?

Third, I may need to pull the number more than once during execution. Do I use a seek(DATA, 0, 0) to go back? Won't that actually put me at the beginning of my whole script? Is there a simple way I can just go back to __DATA__?

And Finally, I need to protect against multiple executions changing it at once. I just flock() my script while I'm changing it to handle that, right?

Thanks in advance for any advice you can share. I've just never tried anything like this before.

James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to