in reply to 'Required' config file produces error if last entry sets variable to zero?
A file which is required or used must end with a true value. Just make
the last line of the config file.1;
It doesn't seem well-known, but return will stop execution of a loaded file, making return 0; a way to cancel loading and return 1; a way to say "You don't need the rest of this."
(Added) To keep strict happy, you should add,
to the top of the file. Tacking on my won't work, since lexical variables only have file scope, at most, and can't be seen from the require-ing program.use vars qw/$v1 ..... $variable $flag/;
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: 'Required' config file produces error if last entry sets variable to zero?
by punch_card_don (Curate) on Jun 11, 2006 at 15:27 UTC |