How to re-"use Module" if the Module has changed?
- From: andrew.fabbro@xxxxxxxxx
- Date: 31 Jan 2006 11:09:50 -0800
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
.
- Follow-Ups:
- Re: How to re-"use Module" if the Module has changed?
- From: DJ Stunks
- Re: How to re-"use Module" if the Module has changed?
- From: Paul Lalli
- Re: How to re-"use Module" if the Module has changed?
- Prev by Date: Re: why doesn't sort properly?
- Next by Date: Re: How to re-"use Module" if the Module has changed?
- Previous by thread: FAQ 1.15 Where can I get a list of Larry Wall witticisms?
- Next by thread: Re: How to re-"use Module" if the Module has changed?
- Index(es):
Relevant Pages
|