in reply to Re^5: At which line number did the print statement occure?
in thread At which line number did the print statement occure?

caller is more reliable for this.
#!/usr/bin/perl package Foo; sub new { # ... } # other stuff if (!caller()) { my $foo = new Foo; # test foo's methods, etc } 1;