Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Let a module call a sub of the caller

by Jenda (Abbot)
on Sep 07, 2012 at 13:20 UTC ( #992312=note: print w/ replies, xml ) Need Help??


in reply to Let a module call a sub of the caller

use My::Module call => sub { ... };

The catch is that if the anonymous subroutine you pass to the module gets called directly from within the import() subroutine, you may not call subroutines defined under the use statement. So you may have to move the use statement a little lower in the code. It doesn't have to be right on top!

Jenda
Enoch was right!
Enjoy the last years of Rome.


Comment on Re: Let a module call a sub of the caller
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992312]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (13)
As of 2016-02-10 13:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (346 votes), past polls