in reply to calling a subroutine while Initializing new
Which subroutine?
If you're talking about the constructor new(), it should be in MYPACKAGE. (I say "should be" because with the syntax you're using there, a lot of weird things could happen. I recommend instead my $instance = MYPACKAGE->new( READ_ONLY => 1, \&subroutine );.)
If you're talking about subroutine(), it depends. The only necessary condition is that there is a subroutine of that name in the current package. However it is in that package, whether by declaration or export or AUTOLOAD or installation into the symbol table otherwise, it just has to be there.
|
|---|