in reply to Re: Let a module call a sub of the caller
in thread Let a module call a sub of the caller
I just wanted to facilitate the use of a Module and avoid exorting into the caller's namespace. In particular, the Module does not just call the method but does some processing to pass it the right parameters. The same could be done with an export:
use My::Module qw(call); call(\&foo); sub foo { ... };
I am not that familiar with the processing phases BEGIN,INIT,END, that's why I asked. Is there a way to call the method at the END of execution of the caller?:
use My::Module call => 'foo'; sub foo { ... }; # foo is called at the end
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Let a module call a sub of the caller
by moritz (Cardinal) on Sep 07, 2012 at 10:02 UTC |
In Section
Seekers of Perl Wisdom