How to re-"use Module" if the Module has changed?



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

.



Relevant Pages

  • Re: How to re-"use Module" if the Module has changed?
    ... > I have a script which runs as a daemon. ... > to change some of the config variables for it. ...
    (comp.lang.perl.misc)
  • Re: setup mail server
    ... I should warn you that I've had some issues with the Dovecot POP/IMAP ... It's a nice daemon: very easy and simple to configure because ... leave messages on the server, causing them to download ALL of their old ... > dont remmember the standard config that comes with Fedora, ...
    (Fedora)
  • Re: Adding additional postfix server to init daemon
    ... Does anyone have an idea as to add additional postfix servers? ... You'll see the config dir for the second instance ... $DAEMON start 2>&1 | ... echo "." ...
    (Debian-User)
  • Re: Adding additional postfix server to init daemon
    ... Does anyone have an idea as to add additional postfix servers? ... You'll see the config dir for the second instance ... $DAEMON start 2>&1 | ... echo "." ...
    (Debian-User)
  • Re: Check the DB-handle status.
    ... I want to check the status of my db, in my daemon on a regular base. ... Also I want to reread the DB config. ...
    (perl.beginners)