Since IPC::Lite is just pushing the variable into your namespace as a global variable, I'd think a fully-scoped name would eliminate the error:
Of course, if your namespace isn't main, then substitute appropriately, e.g., @LearnedByError::urls. Or just turn off the warning for undeclared variables around the code that uses @urls - to some people this is the "right" solution, though I'd prefer avoiding it where possible.use IPC::Lite (); # always load it, why not? if ($saving) { IPC::Lite->import( Key => $0, qw(@urls) ); } push @::urls, '...';
Though, to be honest, I'm surprised our @urls before the IPC::Lite->import... doesn't work.
In reply to Re: Conditional loading of module with global exports
by Tanktalus
in thread Conditional loading of module with global exports
by learnedbyerror
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |