How can I find the source location of a print statement in Perl?
#!/usr/bin/perl
foo();
bar();
sub foo {
print "foo\n";
}
sub bar {
print "bar\n";
}
The output being:
>perl test.pl
foo
bar
I'd like to somehow find be able to see (or something like)
>perl test.pl
main::foo> foo
main::bar> bar
The reason for this is I'm trying to track down some rouge output, and cannot find its location in a large code base.