Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Adding code to a Perl program without stopping it

by Anonymous Monk
on Mar 26, 2011 at 08:06 UTC ( #895644=note: print w/replies, xml ) Need Help??


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

Yup, do, require, Apache::StatINC, Module::Reload, Module::Pluggable, Plack::Loader::Shotgun
  • 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 spx2 (Deacon) on Apr 04, 2011 at 00:18 UTC

    Module::Reload->check() basically does:

    • delete $INC{module_name};
    • require 'module_name' ;

    but only if the modified_time of the package has changed on disk, which is very nice, Module::Reload works properly.

    However, what if you delete a sub from a module while running the program, the function will remain loaded. That needs to be fixed in Module::Pluggable.

    I took a look at Apache::StatINC and it does the same as Module::Reload except it does delete the subs that are gone using this:

    • $class->Apache::Symbol::undef_functions( undef, 1 );

    However, I guess Apache::StatINC can be use only if you're writing a web app deployed using Apache. What if you want to write a non-web app(an IRC bot for example) ?

    Plack::Loader::Shotgun I wasn't able to check out because I'm not familiar with Plack

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2023-02-09 11:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (45 votes). Check out past polls.

    Notices?