diff options
Diffstat (limited to 'lib/Parse/PMFile.pm')
-rw-r--r-- | lib/Parse/PMFile.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Parse/PMFile.pm b/lib/Parse/PMFile.pm index af4f705..00d31c3 100644 --- a/lib/Parse/PMFile.pm +++ b/lib/Parse/PMFile.pm @@ -10,7 +10,7 @@ use Dumpvalue; use version (); use File::Spec (); -our $VERSION = '0.45'; +our $VERSION = '0.46'; our $VERBOSE = 0; our $ALLOW_DEV_VERSION = 0; our $FORK = 0; @@ -358,9 +358,12 @@ sub _packages_per_pmfile { local $/ = "\n"; my $inpod = 0; + my $checked_bom; PLINE: while (<$fh>) { chomp; my($pline) = $_; + $pline =~ s/\A(?:\x00\x00\xfe\xff|\xff\xfe\x00\x00|\xfe\xff|\xff\xfe|\xef\xbb\xbf)// unless $checked_bom; + $checked_bom = 1; $inpod = $pline =~ /^=(?!cut)/ ? 1 : $pline =~ /^=cut/ ? 0 : $inpod; next if $inpod; |