X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FModule-Metadata.git;a=blobdiff_plain;f=lib%2FModule%2FMetadata.pm;h=376853a4b4646d7df2f4f5465f7db2716ad20fed;hp=379fdb49e2c10bc1936fb463451d295adcd6f1ad;hb=30890a124324523de936425b4e28e381ab533170;hpb=5941a3ee05b437f6273e5e76868d3f99cfe6dc72 diff --git a/lib/Module/Metadata.pm b/lib/Module/Metadata.pm index 379fdb4..376853a 100644 --- a/lib/Module/Metadata.pm +++ b/lib/Module/Metadata.pm @@ -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 ) =