in reply to How do I know if I'm in a BEGIN block?
[kirsle@damocles ~]$ cat begin.pl #!/usr/bin/perl -w use begin; BEGIN { begin::myfunc(); } print "lalala\n"; begin::myfunc(); [kirsle@damocles ~]$ cat begin.pm package begin; sub myfunc { my @caller = caller(1); print "caller info: @caller\n"; } 1; [kirsle@damocles ~]$ perl begin.pl Use of uninitialized value $caller[6] in join or string at begin.pm li +ne 5. Use of uninitialized value $caller[7] in join or string at begin.pm li +ne 5. Use of uninitialized value $caller[10] in join or string at begin.pm l +ine 5. caller info: main begin.pl 7 main::BEGIN 1 0 256 UUUUUUUUUUUU lalala caller info:
|
---|