From: Craig A. Berry Date: Sun, 9 Sep 2007 00:31:51 +0000 (+0000) Subject: Band-aid for Pod::Man::devise_title to keep it from looking X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f7befa134c5fcd96ce7c34d7921b8eb76021ef9a;p=p5sagit%2Fp5-mst-13.2.git Band-aid for Pod::Man::devise_title to keep it from looking beyond the end of an array and generating undefined warnings. p4raw-id: //depot/perl@31825 --- diff --git a/lib/Pod/Man.pm b/lib/Pod/Man.pm index 077bd7b..a8b41bb 100644 --- a/lib/Pod/Man.pm +++ b/lib/Pod/Man.pm @@ -40,7 +40,7 @@ use POSIX qw(strftime); # Don't use the CVS revision as the version, since this module is also in Perl # core and too many things could munge CVS magic revision strings. This # number should ideally be the same as the CVS revision in podlators, however. -$VERSION = '2.12'; +$VERSION = '2.12_01'; # Set the debugging level. If someone has inserted a debug function into this # class already, use that. Otherwise, use any Pod::Simple debug function @@ -792,7 +792,7 @@ sub devise_title { my $cut = 0; my $i; for ($i = 0; $i < scalar @dirs; $i++) { - if ($dirs[$i] eq 'lib' && $dirs[$i + 1] =~ /perl/) { + if ($dirs[$i] eq 'lib' && $i+1 < scalar(@dirs) && $dirs[$i + 1] =~ /perl/) { $cut = $i + 2; last; } elsif ($dirs[$i] =~ /perl/) {