You want caller, But...
Why mess with one code block with two names? Just make two subs, or see File::Spec for a better way to do this job.
Update: broquaint is correct about caller not doing what you want:
$ perl -e'sub foo {print( (caller 0)[3], $/)} local *bar = \&foo; bar( +)' main::foo $ perl -e'$foo = sub {print( (caller 0)[3], $/)}; local *bar = $foo; b +ar()' main::__ANON__ $
After Compline,
Zaxo
In reply to Re: aliasing subs
by Zaxo
in thread aliasing subs
by december
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |