Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: keeping something in memory after the end of script

by NetWallah (Canon)
on Apr 15, 2016 at 17:46 UTC ( [id://1160547]=note: print w/replies, xml ) Need Help??


in reply to keeping something in memory after the end of script

If the "Next run" is started from the same shell, or a child of that shell, you could use "export"ed environment variables to persist data, as suggested here.

        This is not an optical illusion, it just looks like one.

Replies are listed 'Best First'.
Re^2: keeping something in memory after the end of script
by fullermd (Priest) on Apr 15, 2016 at 18:38 UTC

    Not really (at least, not without some sort of nutso magic trick). The shell would be the parent process of your script; you can't mess with your parent's environment.

      Point taken (++), but the magic is not too achene:
      ~$ chksum=$(perl -e'print qq|Set by perl|'); echo BASH says chksum is +$chksum BASH says chksum is Set by perl

              This is not an optical illusion, it just looks like one.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-03-29 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found