in reply to Is it possible to call a package::main subroutine from a module?
Does this help?
{ package x; my $subref; sub set{ $subref = shift }; sub call{ $subref->( @_ ) }; };; sub test{ print "This is sub test() with args:[ @_ ]"; };; x::set( \&test );; x::call( 1, 2.0, 'three' );; This is sub test() with args:[ 1 2 three ]
|
|---|