Well, if you pass in 0 (caller(0)) then you get the caller information for the current stack frameAnd the current stack frame still shows who called you, not who you are. You can't determine the current filename using caller:
$ cat /tmp/x sub f { my $f = (caller(0))[1]; print "I am: ", __FILE__, "\n"; print "caller: $f\n"; } 1; $ perl585 -e 'require "/tmp/x"; f()' I am: /tmp/x caller: -e $
Dave.
In reply to Re^4: Code asks, in what file do I live?
by dave_the_m
in thread Code asks, in what file do I live?
by water
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |