good chemistry is complicated,
and a little bit messy -LW
Dereferencing %hash that does not exist.by perldarren (Novice)
|on Sep 04, 2013 at 10:09 UTC||Need Help??|
perldarren has asked for the
wisdom of the Perl Monks concerning the following question:
Hi, I'm having some trouble and would appreciate some advice.
I have a couple of scripts that reference the same perl module.
In some of the scripts I want to pass a dispatch table to the module and in others I do not, where I do, I pass:
Where I don't I WANT to pass:
In the module exit_routine dereferences %modifier like this:
The scripts that do not pass %modifier result in:
Can't use an undefined value as a HASH reference at /usr/local/lib/perl5/site_perl/5.10.1/...
Whilst those that do pass %modifier work as expected.
My question is - How can I make this work for both scenarios? Preferably I would like to modify the module so that it can deal with the 2 scenarios and save me from modifying all of the scripts that use it.
Many thanks for your time and patience.