Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The var is declared in the module but not defined. Some sub just asks if ($Module::configvar), which works, but only for the call to menu() made from the script. AFAIK the var is not being redefined anywhere in the module and it's not a persistent environment so... I'm stumped.use Module; $Module::configvar = 1; print Module::menu(); # <- this works, configvar is set, but # not when invoking other subs from the options in menu().
Hope this is enough information to spot my dumb mistake. I wrote a test module and script which worked as expected: the var was seen by other subs when invoked by the initially called sub. So I seem to know what I'm doing but dunno what's wrong with this module and can't post the actual code. Thanks for your consideration.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: package variable does not persist
by Corion (Patriarch) on Sep 01, 2018 at 07:23 UTC | |
|
Re: package variable does not persist
by AnomalousMonk (Archbishop) on Sep 01, 2018 at 08:06 UTC | |
|
Re: package variable does not persist
by AnomalousMonk (Archbishop) on Sep 01, 2018 at 08:41 UTC | |
by haukex (Archbishop) on Sep 01, 2018 at 10:24 UTC | |
by Anonymous Monk on Sep 01, 2018 at 18:35 UTC | |
|
Re: package variable does not persist
by haukex (Archbishop) on Sep 01, 2018 at 10:36 UTC |