in reply to Re: accessing subs/methods from the module
in thread accessing subs/methods from the module
My question would be, can I inside the module for "Blah" access a variable in the main program? That variable also happens to be $f, an instance of "Foobar."
Let me fix my example too.
main code:
use Blah; use Foobar; $b = Blah->new(); $f = Foobar->new(); $b->doSomething;
and inside the Blah module:
sub new { ... } sub doSomething { $f->methodX(); }
And inside the Foobar module:
sub new { ... } sub methodX { does some fun things here }
So basically, method "doSomething" is invoked. I want to be able for "doSomething" to access variable in the main program $f. $f just happens to be an instance of "Foobar."
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: accessing subs/methods from the module
by artist (Parson) on Feb 06, 2003 at 20:23 UTC | |
|
Re: Re: Re: accessing subs/methods from the module
by steves (Curate) on Feb 06, 2003 at 19:20 UTC | |
by shrubbery (Acolyte) on Feb 06, 2003 at 21:03 UTC | |
|
Re3: accessing subs/methods from the module
by dragonchild (Archbishop) on Feb 06, 2003 at 20:14 UTC |