in reply to accessing subs/methods from the module
I'd say that you were looking at the problem from the wrong end. In order that any code within your Blah module is run, you have to call it from the main program (unless it has a BEGIN{} INIT{} END{} etc. blocks, but thats a special case.).
So the way to tackle your problem is to pass the vars that you need to access in main into the code in Blah when you call it. Eg.
use Blah; sub new{...} sub doSomething{ my $foobar = shift; $foobar->someMethod(); ... } ...
main
use Blah; use FooBar; my $f = FooBar->new(); my $b = Blah->new(); $b->doSomthing( $f );
Examine what is said, not who speaks.
The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.
|
|---|