Re: How to re-"use Module" if the Module has changed?
- From: "Paul Lalli" <mritty@xxxxxxxxx>
- Date: 31 Jan 2006 11:20:21 -0800
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
.
- Follow-Ups:
- Re: How to re-"use Module" if the Module has changed?
- From: Uri Guttman
- Re: How to re-"use Module" if the Module has changed?
- References:
- How to re-"use Module" if the Module has changed?
- From: andrew . fabbro
- How to re-"use Module" if the Module has changed?
- Prev by Date: How to re-"use Module" if the Module has changed?
- Next by Date: Re: split the sequences
- Previous by thread: How to re-"use Module" if the Module has changed?
- Next by thread: Re: How to re-"use Module" if the Module has changed?
- Index(es):
Relevant Pages
|