Login
RT #61311: Subroutines::ProhibitUnusedPrivateSubroutines dies on
"&_name" call
The problem was that the return value of sprevious_sibling() was being
incorrectly tested.
About 12 lines into sub _find_sub_reference_in_document(), and again
about 18 lines in, the code 'defined $prior' occurs. The 'defined'
should be removed; that is, the code should just be '$prior'.
The erroneous code assumed that the PPI method sprevious_sibling()
returned undef if there was no previous sibling in the parse tree. In
fact, it is documented as returning a false value.