in reply to Re^2: Can I from within a module access variables from the calling program?
in thread Can I from within a module access variables from the calling program?
Hi HJO,
Try this, In your module declare global variable, then export variable
.... our %glo_var = ('a'=>100,'b'=>200); ... @EXPORT = qw(%glo_var ... members); ... 1;
In your tool
use SampleModule::TestMod; print $glo_var{'a'};exit;
Output=100
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Can I from within a module access variables from the calling program?
by HJO (Acolyte) on Oct 25, 2012 at 12:49 UTC |
In Section
Seekers of Perl Wisdom