Subject: | Warning from $doc->index_locations() on empty document |
If you do the following:
perl -w -MPPI::Document -e 'my $doc = PPI::Document->new( \"" );
$doc->index_locations();'
you get the following warning:
Use of uninitialized value $first in foreach loop entry at
/usr/local/perl/5.12.1/lib/site_perl/5.12.1/PPI/Document.pm line 620.
You get the same error (plus some others) if for some reason you call
index_locations() twice on the same document.
Yes, this is mostly cosmetic. It turned up in a Perl::Critic test that
was added to be sure that a uses_module() method would work in the case
of a module without 'use' statements.
A patch to both PPI::Document and t/03_document.t follows.