in reply to how to find the original sub definition

Are you sure the subroutine is actually inside that package? Either it's not, or you're using do instead of require.
  • Comment on Re: how to find the original sub definition

Replies are listed 'Best First'.
Re^2: how to find the original sub definition
by Anonymous Monk on Dec 22, 2010 at 19:51 UTC
    I am pretty sure. The XYZ module is structured as follows:
    #!/usr/bin/perl package XYZ; use warnings; use strict; use Pod::Usage; { my $PrivateLexicalData; sub do_something_useful { ... } } # End of private lexial scope sub test { do_something_useful(3) == 2 or die; print "Tests complete\n." exit(0); } if (not defined caller()) { scalar @ARGV == 0 and pod2usage(); grep { m/-test/i } @ARGV and test(); } 1; =head1 NAME ...
      Found it! There was another 'XYZ' package with a test sub.