A
andrew.fabbro
I have a script which runs as a daemon. Periodically, the user wants
to change some of the config variables for it. Right now, those config
variables are stored in a perl module, and the daemon does a 'use
Module' to import them at run-time.
What I'd like to do is have the module reread its config if it gets a
HUP signal. But how can I say "go and 'use Module' again"? It appears
that if you 'use Module' more than once, subsequent calls are ignored.
For example:
use Module;
print "Value is " . $Module::some_var . "\n";
$junk = <STDIN>; # go and change the value in Module, then hit enter
use Module; # try to re-use and get the new value
print "Value is " . $Module::some_var . "\n";
....and the lines printed are the same (the value of $Module::some_var
does not change in the program).
Ideas? Thanks.
-Drew
to change some of the config variables for it. Right now, those config
variables are stored in a perl module, and the daemon does a 'use
Module' to import them at run-time.
What I'd like to do is have the module reread its config if it gets a
HUP signal. But how can I say "go and 'use Module' again"? It appears
that if you 'use Module' more than once, subsequent calls are ignored.
For example:
use Module;
print "Value is " . $Module::some_var . "\n";
$junk = <STDIN>; # go and change the value in Module, then hit enter
use Module; # try to re-use and get the new value
print "Value is " . $Module::some_var . "\n";
....and the lines printed are the same (the value of $Module::some_var
does not change in the program).
Ideas? Thanks.
-Drew