in reply to Re: Re: accessing subs/methods from the module
in thread accessing subs/methods from the module

It's bad style, but yes:

package Blah; sub doSomething { $main::f->whatever(); }
As long as $f is a package variable in main -- i.e., not declared with my, my preference being:
our $f = Foobar->new();
... and as long as I don't have to maintain your code. You have factoring issues here that should be keeping you awake at night.

Replies are listed 'Best First'.
Re: Re: Re: Re: accessing subs/methods from the module
by shrubbery (Acolyte) on Feb 06, 2003 at 21:03 UTC
    Great thanks!

    Not really up to me, I thought it wasn't the best in design either. However, it does beat some other alternatives we thought up.