In recognition that Larry is writing POD in which
=head1 NAME
and
=head1 AUTHOR
Can be spelled
=head1 Name
=head1 Author
See, e.g.:
http://www.mail-archive.com/perl6-language@xxxxxxxx/msg16862.html
I propose the following patch to allow these headers to be
case-insensitive.
Regards,
David
--- PodParser.pm.~1.5.~ Wed May 12 21:48:56 2004
+++ PodParser.pm Thu Sep 16 20:49:25 2004
@@ -39,7 +39,7 @@
my @author;
while (<$fh>) {
- next unless /^=head1\s+AUTHOR/ ... /^=/;
+ next unless /^=head1\s+AUTHOR/i ... /^=/;
next if /^=/;
push @author, $_ if /\@/;
}
@@ -90,10 +90,10 @@
my ($self, $text) = @_;
$text =~ s/^\s+//;
$text =~ s/\s+$//;
- if ($self->{_head} eq 'NAME') {
+ if (uc $self->{_head} eq 'NAME') {
my ($name, $abstract) = split( /\s+-\s+/, $text, 2 );
$self->{abstract} = $abstract;
- } elsif ($self->{_head} eq 'AUTHOR') {
+ } elsif (uc $self->{_head} eq 'AUTHOR') {
push @{$self->{author}}, $text if $text =~ /\@/;
}
}
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
|