Patch provided by Daniel Klein <danielklein-à-airpost.net> :
It also doesn't check for invalid POD which gets ignored by the
compiler anyway.
Seems that Damian had a POD parser in mind when he devised those
regular expressions, but perl only looks for =cut followed by a
non-letter.
return !$ishash;
}
-
-my $EOP = qr/\n|\Z/;
-my $CUT = qr/\n=cut.*$EOP/;
-my $pod_or_DATA = qr/ ^=(?:head[1-4]|item) .*? $CUT
- | ^=pod .*? $CUT
- | ^=for .*? $EOP
- | ^=begin \s* (\S+) .*? \n=end \s* \1 .*? $EOP
- | ^__(DATA|END)__\n.*
- /smx;
+my $pod_or_DATA = qr/ ^=[A-Za-z] .*? ^=cut (?![A-Za-z]) .*? $
+ | ^__(DATA|END)__\n.*
+ /smx;
my $casecounter = 1;
sub filter_blocks