in reply to Conditional loading of module with global exports
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Conditional loading of module with global exports
by learnedbyerror (Monk) on Feb 23, 2016 at 00:20 UTC |