http://perldoc.perl.org/functions/caller.html
caller() usually shows caller’s package name , filename, line , function etc.
If you specify the argument “0” , caller(0) function shows self-method infomation.
#!/usr/local/bin/perl
use strict;
use warnings;
use Data::Dumper;
main();
sub main {
dummy_func1('ABCDE');
}
sub dummy_func1 {
my @args = @_;
print join(' , ', caller(0) ),"n";
}
1;
The following is the result of executing script.
$ ./foo.pl
Use of uninitialized value in join or string at ./foo.pl line 15.
Use of uninitialized value in join or string at ./foo.pl line 15.
Use of uninitialized value in join or string at ./foo.pl line 15.
Use of uninitialized value in join or string at ./foo.pl line 15.
main , ./foo.pl , 9 , main::dummy_func1 , 1 , , , , 1762 , UUUUUUUUUUUUUU ,