£okì has asked for the wisdom of the Perl Monks concerning the following question:
to reload a module when using POE::Component::IRC. The on_public subroutine is the only sub (the only anything now) in the module contrib.pl (for testing). When I run the reloader, nothing reloads. However, here's when it gets funny. If I just write a testing script that does the same reload but not using POE, it works. Now, here are the two places I THINK there could be a problem. 1:sub reload_module { undefSub("on_public"); delete $INC{"contrib.pl"}; require "contrib.pl"; }
Could it be that when you use this type of session that it caches the subroutine? If so, how to I force this session to refresh without reconnecting? 2: In the on_public subroutine, it basically just outputs thisPOE::Session->new ( _start => \&bot_start, irc_001 => \&on_connect, irc_public => \&on_public, irc_notice => \&on_notice, irc_msg => \&on_msg, );
Could it be caching that?? Anyone know? I'd bet it's #1 but I don't know how to go about clearing out that session info.$_[KERNEL]->post( $irc{server} => privmsg => $irc{chan}, "\0037 this i +s the standard test!");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Caching of Subroutines
by revdiablo (Prior) on Jan 03, 2005 at 18:30 UTC | |
by £okì (Scribe) on Jan 03, 2005 at 18:45 UTC | |
|
Re: Caching of Subroutines
by simonm (Vicar) on Jan 03, 2005 at 18:43 UTC |