in reply to aliasing subs
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: aliasing subs
by december (Pilgrim) on May 06, 2003 at 11:47 UTC | |
by dragonchild (Archbishop) on May 06, 2003 at 14:26 UTC |