summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-09-09 23:21:48 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-09-09 23:21:48 -0700
commit0b2be16900832ccd9de494ff538bf070d8623089 (patch)
treea637520af287379ec1cb4aba95bec823d6f3fbf3 /dist
parente001c7126641d25781fc1e649e4b35356a346586 (diff)
downloadperl-0b2be16900832ccd9de494ff538bf070d8623089.tar.gz
[perl #92436] Filter::Simple can’t find end of POD
Filter::Simple’s $pod_or_DATA regexp was mistakenly written to look for =end if the pod section began with =begin, and to look for the end of the paragraph if the pod began with =for. Only =cut and EOF can end pod. This patch does not fix Filter::Simple’s naïve way of finding the beginning of pod.
Diffstat (limited to 'dist')
-rw-r--r--dist/Filter-Simple/lib/Filter/Simple.pm6
-rw-r--r--dist/Filter-Simple/t/filter_only.t14
-rw-r--r--dist/Filter-Simple/t/lib/Filter/Simple/FilterOnlyTest.pm3
3 files changed, 20 insertions, 3 deletions
diff --git a/dist/Filter-Simple/lib/Filter/Simple.pm b/dist/Filter-Simple/lib/Filter/Simple.pm
index 2cfa99af37..308ab8c6c6 100644
--- a/dist/Filter-Simple/lib/Filter/Simple.pm
+++ b/dist/Filter-Simple/lib/Filter/Simple.pm
@@ -4,7 +4,7 @@ use Text::Balanced ':ALL';
use vars qw{ $VERSION @EXPORT };
-$VERSION = '0.87';
+$VERSION = '0.88';
use Filter::Util::Call;
use Carp;
@@ -36,8 +36,8 @@ 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
+ | ^=for .*? $CUT
+ | ^=begin .*? $CUT
| ^__(DATA|END)__\r?\n.*
/smx;
diff --git a/dist/Filter-Simple/t/filter_only.t b/dist/Filter-Simple/t/filter_only.t
index f30fced6a1..57f108677e 100644
--- a/dist/Filter-Simple/t/filter_only.t
+++ b/dist/Filter-Simple/t/filter_only.t
@@ -20,6 +20,20 @@ print "ok 5\n";
ok 7 unless not ok 6;
+=begin scrumbly
+
+=end scrumbly
+
+shromple
+
+=cut
+
+=for us
+
+shromple again
+
+=cut
+
no Filter::Simple::FilterOnlyTest; # THE FUN STOPS HERE
print "not " unless "not ok" =~ /^not /;
diff --git a/dist/Filter-Simple/t/lib/Filter/Simple/FilterOnlyTest.pm b/dist/Filter-Simple/t/lib/Filter/Simple/FilterOnlyTest.pm
index c10e8ea29f..e692f8b99d 100644
--- a/dist/Filter-Simple/t/lib/Filter/Simple/FilterOnlyTest.pm
+++ b/dist/Filter-Simple/t/lib/Filter/Simple/FilterOnlyTest.pm
@@ -8,4 +8,7 @@ FILTER_ONLY
while (my($pat, $str) = splice @_, 0, 2) {
s/$pat/$str/g;
}
+ },
+ code_no_comments => sub {
+ $_ =~ /shromple/ and die "We wants no shromples!";
};