opensourcer has asked for the wisdom of the Perl Monks concerning the following question:
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: accessing module variables howto
by davido (Cardinal) on Aug 29, 2006 at 07:07 UTC | |
|
Re: accessing module variables howto
by jaa (Friar) on Aug 29, 2006 at 07:32 UTC | |
|
Re: accessing module variables howto
by shmem (Chancellor) on Aug 29, 2006 at 08:08 UTC |