Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Adding code to a Perl program without stopping it

by TomDLux (Vicar)
on Mar 27, 2011 at 16:40 UTC ( [id://895773]=note: print w/replies, xml ) Need Help??


in reply to Adding code to a Perl program without stopping it

If you're running on Unix, you can send a signal (kill) which your process catches. The signal handler reads a file which contains a list of modules and versions which should be loaded, and compares those with what actually is loaded, and loads / reloads the missing ones.

On the other hand, loading your whiz-bang "Divide-by-zero" module is little benefit if there are no calls to it.

As Occam said: Entia non sunt multiplicanda praeter necessitatem.

  • Comment on Re: Adding code to a Perl program without stopping it

Replies are listed 'Best First'.
Re^2: Adding code to a Perl program without stopping it
by GrandFather (Saint) on Mar 27, 2011 at 20:04 UTC
    if there are no calls to it

    which is why when you use the delete $INC{...}/require technique you generally either only update a set of known volotile modules, or you use a registration processes with a known entry point in the modules.

    I use the registration technique to add new task handlers to a distributed task handling system that provides automated build and testing services. It allows me to add or correct task handlers without restarting (currently) six systems.

    True laziness is hard work

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-24 03:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found