in reply to Code references as use() parameters
And the code that uses the modulepackage pmsopw_249244; sub import { push @pmsopw_249244::USES, [scalar caller, @_[1 .. $#_]]; } sub real_import { $_->() for @_[1 .. $#_]; } INIT { for (@pmsopw_249244::USES) { my($pkg, @args) = @$_; eval (qq[{ package $pkg; pmsopw_249244->real_import(\@args); }]); warn "ack - $@" if $@; } } q{ the end is nigh ...};
That might not be stellar code but hopefully it gives you some ideas.use pmsopw_249244 (\&func); sub func { print "I've been called\n"; } __output__ I've been called
_________
broquaint
|
|---|