voj has asked for the wisdom of the Perl Monks concerning the following question:
I'd like to create a Module that calls a sub defined by the caller. For instance:
Should call "foo" after compilation (not during BEGIN). Could the module somehow define an INIT block that calls the sub?use My::Module call => 'foo'; sub foo { ... };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Let a module call a sub of the caller
by SuicideJunkie (Vicar) on Sep 06, 2012 at 19:11 UTC | |
|
Re: Let a module call a sub of the caller
by moritz (Cardinal) on Sep 06, 2012 at 19:24 UTC | |
by voj (Acolyte) on Sep 07, 2012 at 07:22 UTC | |
by moritz (Cardinal) on Sep 07, 2012 at 10:02 UTC | |
|
Re: Let a module call a sub of the caller
by ikegami (Patriarch) on Sep 06, 2012 at 23:57 UTC | |
|
Re: Let a module call a sub of the caller
by tobyink (Canon) on Sep 07, 2012 at 12:38 UTC | |
|
Re: Let a module call a sub of the caller
by locked_user sundialsvc4 (Abbot) on Sep 06, 2012 at 22:44 UTC | |
|
Re: Let a module call a sub of the caller
by Jenda (Abbot) on Sep 07, 2012 at 13:20 UTC | |
|
Re: Let a module call a sub of the caller
by clueless newbie (Curate) on Sep 07, 2012 at 12:00 UTC |