package Foo; sub do_something { print scalar caller, "\n"; } sub import { my $target = caller; no strict 'refs'; *{"$target:\:do_something"} = \&do_something; } 1;
In reply to Re: Defining a function in the caller's package
by mr_mischief
in thread Defining a function in the caller's package
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |