Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Forcing a PERL script to reload librariesby Anonymous Monk |
on Dec 20, 2000 at 20:13 UTC ( [id://47598]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a very complex PERL script that I use for my radio station (plug away: http://ourthing.radio.binary9.net). Everytime I make a modification to my main "playdaemon" script, I have to kill it and restart it; which causes a hiccup in the stream (and restarts the current song).
What I would like to do is something like this (non-functioning):
playdaemon: #!/usr/bin/perl require "MyRoutines.pl"; $SIG{HUP}=sub { require "MyRoutines.pl"; }; while (1) { DoIt(); } __END__Then, as I change the contents of MyRoutines.pl, I could send a SIGHUP to my program and it would reload the contents of MyRoutines.pl to reflect the changes. Is such a thing possible? I believe my problem is that PERL already knows it has loaded the MyRoutines.pl library and won't do so again. How many I accomplish this? TIA!
Back to
Seekers of Perl Wisdom
|
|