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
In reply to Re: 'Required' config file produces error if last entry sets variable to zero?
by Zaxo
in thread 'Required' config file produces error if last entry sets variable to zero?
by punch_card_don
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |