Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: No garbage collection for my-variables (exec code)

by tye (Sage)
on Sep 16, 2008 at 04:16 UTC ( [id://711603]=note: print w/replies, xml ) Need Help??


in reply to Re: No garbage collection for my-variables
in thread No garbage collection for my-variables

Hmm, that FAQ answer could do with some code:

exec( $^X, $0, @ARGV ) or die "Can't execute self so killing self: $!\n";

- tye        

Replies are listed 'Best First'.
Re^3: No garbage collection for my-variables (exec code)
by repellent (Priest) on Sep 16, 2008 at 04:38 UTC
    Nice!

    Also remember: don't shift your @ARGV ;-)

    But seriously, wouldn't it be more involved since we need to consider saving the program "state" and resume it somehow?
      But seriously, wouldn't it be more involved since we need to consider saving the program "state" and resume it somehow?

      Not always. In fact, quite often, if you do the exec when you aren't in the middle of something, that is all the code you need. Servers usually process transactions and it is usually a bad idea to have your stuff break because critical data is stored nowhere other than the memory of some service.

      - tye        

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found