You can get more information by calling caller in list context
Actually (caller)[0] does call it in list context. The number of arguments to caller matters, though:
$ perl -wle 'sub foo { my @l = caller(); return scalar @l }; print foo +()' 3 $ perl -wle 'sub foo { my @l = caller(0); return scalar @l }; print fo +o()' 10
In reply to Re^2: Identify the package a subroutine is being called from
by moritz
in thread Identify the package a subroutine is being called from
by Herkum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |