in reply to Where is implementation of $0 in Perl source code
Reading from the $0 variable is implemented in the "case '0'" branch of the switch within the function Perl_magic_get() in mg.c.$ cat /tmp/Foo.pm sub f { print $0, ",", (caller)[1], "\n"; } f(); 1; $ perl -I/tmp -MFoo -e1 -e,/tmp/Foo.pm $
Caller is implemented by the pp_caller() function in pp_ctl.c
Dave.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Where is implementation of $0 in Perl source code
by dave_the_m (Monsignor) on May 27, 2015 at 18:30 UTC |