Skip Menu |

This queue is for tickets about the Perl-Tags CPAN distribution.

Report information
The Basics
Id: 20608
Status: resolved
Priority: 0/
Queue: Perl-Tags

People
Owner: Nobody in particular
Requestors: DMITRI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.23
Fixed in: (no value)



Subject: Finding subroutine declarations in POD.
0.23 find subrouting declarations in POD and tags them. My POD looks like this: __END__ ... # part of code example: sub localized (&$); ... =cut Should probably ignore POD.
Attached is the patch to skip POD when parsing files. - Dmitri.
--- Tags.pm.orig 2006-07-21 11:55:09.000000000 -0400 +++ Tags.pm 2006-07-21 12:24:34.000000000 -0400 @@ -79,6 +79,19 @@ use overload q("") => \&to_string; our $VERSION = 0.23; +{ + # Tags that start POD: + my @start_tags = qw(pod head1 head2 head3 head4 over item back begin + end for encoding); + my @end_tags = qw(cut); + + my $startpod = '^=(?:' . join('|', @start_tags) . ')\b'; + my $endpod = '^=(?:' . join('|', @end_tags) . ')\b'; + + sub STARTPOD { qr/$startpod/ } + sub ENDPOD { qr/$endpod/ } +} + =head2 C<new> L<Perl::Tags> is an abstract baseclass. L<Perl::Tags::Naive> is provided @@ -281,8 +294,11 @@ # default line by line parsing. Or override it + my $start = STARTPOD; + my $end = ENDPOD; while (<$IN>) { + next if (/$start/o .. /$end/o); # Skip over POD. chomp; my $statement = my $line = $_; PARSELOOP: for my $parser (@parsers) {
Should be fixed in 0.27