X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FModule%2FMetadata.pm;h=0b48828826aea5f25aaba4378109e498a572d90f;hb=c4c5b1f0322a07e5cd539a571686560b643de360;hp=c66bd21467bfd85975ed86753c016a39328981bf;hpb=b50a98018a199717f2932fa763ae64967d4c3ee2;p=p5sagit%2FModule-Metadata.git diff --git a/lib/Module/Metadata.pm b/lib/Module/Metadata.pm index c66bd21..0b48828 100644 --- a/lib/Module/Metadata.pm +++ b/lib/Module/Metadata.pm @@ -11,7 +11,7 @@ package Module::Metadata; use strict; use vars qw($VERSION); -$VERSION = '1.000011'; +$VERSION = '1.000013'; $VERSION = eval $VERSION; use Carp qw/croak/; @@ -518,6 +518,7 @@ sub _parse_fh { my $pkg = 'main'; my $pod_sect = ''; my $pod_data = ''; + my $in_end = 0; while (defined( my $line = <$fh> )) { my $line_num = $.; @@ -560,11 +561,18 @@ sub _parse_fh { } else { + # Skip after __END__ + next if $in_end; + # Skip comments in code next if $line =~ /^\s*#/; # Would be nice if we could also check $in_string or something too - last if $line =~ /^__(?:DATA|END)__$/; + if ($line eq '__END__') { + $in_end++; + next; + } + last if $line eq '__DATA__'; # parse $line to see if it's a $VERSION declaration my( $vers_sig, $vers_fullname, $vers_pkg ) =