Why not just pass a reference to the callback sub?
package M; use strict; require Exporter; our @ISA = qw[ Exporter ]; our @EXPORT = qw[ x ]; sub x{ my( $sub ) = @_; &$sub; } 1;
#! perl -slw use strict; use M; sub _x{ print __PACKAGE__ . "_x() called" } x( \&_x ); __END__ P:\test>393046 main_x() called
In reply to Re: Getting module to call importer's function
by BrowserUk
in thread Getting module to call importer's function
by jredburn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |