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



andrew.fabbro@xxxxxxxxx wrote:
> 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.

Completely untested, based soley upon the docs in
perldoc -f require

$SIG{HUP} = sub {
delete $INC{'Module.pm'};
require Module;
Module->import();
};

Hope this at least gets you pointed in the right direction....

Paul Lalli

.



Relevant Pages

  • 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)