http://www.perlmonks.org?node_id=799519


in reply to Updating hard coded variable?

There are ways to do (nearly) anything in Perl but self modifying code is "not a good idea". Is there a reason for not writing out to a persistent store (file/database)?

You could wrap your script inside another script which would capture a return value and then pass that value into the script as a parameter on the next run but again that is a complex and odd way to accomplish what is better done with a data store.