Bobc has asked for the wisdom of the Perl Monks concerning the following question:
But I thought new() returned a reference? So the way I have been accessing my objects in the other files is# File1 use ObjectMaker; # ObjectMaker has all the exporter stuff use Foo; my $Object = ObjectMaker->new(); &Foo::DoSomething(foo, bar, \$Object);
Is there a more accepted way of doing this or am I on the right track?# File 2 package Foo; use ObjectMaker; sub DoSomething { my $foo = shift; my $bar = shift; my $Object = shift; ... my $blub = $$Object->MethodName(blah); } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Objects across files and packages
by itub (Priest) on May 06, 2004 at 21:46 UTC | |
|
Re: Using Objects across files and packages
by NetWallah (Canon) on May 06, 2004 at 21:59 UTC |