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 ]

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: Is it possible to call a package::main subroutine from a module?
  • Download Code