in reply to Re: Conditional loading of module with global exports
in thread Conditional loading of module with global exports
Updated!! Oh Anonymous Monk, please accept my apologies for maligning your good, accurate and valuable advice. Yes, this did work when tested properly
Yes, I did try this. The script will compile; however, the data that is persisted in IPC::Lite is not accessible as @url is the RAM @url.
See the following examples
This code will persist the results using IPC::Lite
use IPC::Lite Key => 'TEST', qw(@urls) ; push( @urls, ("a", "b", "c") );
This code verifies that the data persists
use IPC::Lite Key => 'TEST', qw(@urls) ; foreach ( @urls ) { print "$_\n"; }; OUTPUT: a b c
This code uses the method that you referred
require IPC::Lite; our @urls; IPC::Lite->import( Key => $0, qw( @urls ) ); foreach ( @urls ) { print "$_\n"; }; OUTPUT:
There is no output because the variable accessed is the RAM variable
Thanks for the thought
|
|---|