and im trying to accress $var by using the "use Manager.pm"############## Manager.pm ######### package Manager; use Exporter; @ISA = qw(Exporter); @EXPORT = qw ($var); my $var; sub new { my $caller = shift; my $class = ref($caller); my $self = bless {}, $class; return $self; } sub import { print "Hello world\n"; $var ="PerlHacks"; } 1;
use Manager; my $Mref = Manager::new(); ## i don't want to use $Manager::var ## im looking for other ways of accessing $var. ## doesn't print anything. print $Mref::$var;
In reply to accessing module variables howto by opensourcer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |