X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=cpan%2FPod-Simple%2Flib%2FPod%2FSimple%2FPullParser.pm;h=eaef116e6466e84c81b83c7cf57f272fc9a740f7;hb=433cf6b48b10555baabcf34f887d934c810b586d;hp=15d973134cfe713f8428d52caa2e133ae4440f0a;hpb=490d18887fd62e9b6c93b9bf4f54a9d43e32b034;p=p5sagit%2Fp5-mst-13.2.git diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm index 15d9731..eaef116 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::PullParser; -$VERSION = '2.02'; +$VERSION = '3.13'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} @@ -319,6 +319,7 @@ sub _get_titled_section { my $desperate_for_title = delete $options{'desperate'}; my $accept_verbatim = delete $options{'accept_verbatim'}; my $max_content_length = delete $options{'max_content_length'}; + my $nocase = delete $options{'nocase'}; $max_content_length = 120 unless defined $max_content_length; Carp::croak( "Unknown " . ((1 == keys %options) ? "option: " : "options: ") @@ -366,6 +367,7 @@ sub _get_titled_section { $head1_text_content .= $token->text; } elsif( $token->is_end and $token->tagname eq 'head1' ) { DEBUG and print " Found end of head1. Considering content...\n"; + $head1_text_content = uc $head1_text_content if $nocase; if($head1_text_content eq $titlename or $head1_text_content =~ m/\($titlename_re\)/s # We accept "=head1 Nomen Modularis (NAME)" for sake of i18n @@ -626,7 +628,15 @@ For example, suppose you have a document that starts out: Hoo::Boy::Wowza -- Stuff B yeah! $parser->get_title on that document will return "Hoo::Boy::Wowza -- -Stuff wow yeah!". +Stuff wow yeah!". If the document starts with: + + =head1 Name + + Hoo::Boy::W00t -- Stuff B yeah! + +Then you'll need to pass the C option in order to recognize "Name": + + $parser->get_title(nocase => 1); In cases where get_title can't find the title, it will return empty-string (""). @@ -652,7 +662,15 @@ But if the document starts out: Hooboy, stuff B yeah! then $parser->get_short_title on that document will return "Hooboy, -stuff wow yeah!". +stuff wow yeah!". If the document starts with: + + =head1 Name + + Hoo::Boy::W00t -- Stuff B yeah! + +Then you'll need to pass the C option in order to recognize "Name": + + $parser->get_short_title(nocase => 1); If the title can't be found, then get_short_title returns empty-string (""). @@ -661,22 +679,30 @@ If the title can't be found, then get_short_title returns empty-string This works like get_title except that it returns the contents of the "=head1 AUTHOR\n\nParagraph...\n" section, assuming that that section -isn't terribly long. +isn't terribly long. To recognize a "=head1 Author\n\nParagraph\n" +section, pass the C otpion: + + $parser->get_author(nocase => 1); (This method tolerates "AUTHORS" instead of "AUTHOR" too.) =item $description_name = $parser->get_description This works like get_title except that it returns the contents of the -"=head1 PARAGRAPH\n\nParagraph...\n" section, assuming that that section -isn't terribly long. +"=head1 DESCRIPTION\n\nParagraph...\n" section, assuming that that section +isn't terribly long. To recognize a "=head1 Description\n\nParagraph\n" +section, pass the C otpion: + + $parser->get_description(nocase => 1); =item $version_block = $parser->get_version This works like get_title except that it returns the contents of the "=head1 VERSION\n\n[BIG BLOCK]\n" block. Note that this does NOT -return the module's C<$VERSION>!! +return the module's C<$VERSION>!! To recognize a +"=head1 Version\n\n[BIG BLOCK]\n" section, pass the C otpion: + $parser->get_version(nocase => 1); =back @@ -702,9 +728,22 @@ L. L, which inspired this. +=head1 SUPPORT + +Questions or discussion about POD and Pod::Simple should be sent to the +pod-people@perl.org mail list. Send an empty email to +pod-people-subscribe@perl.org to subscribe. + +This module is managed in an open GitHub repository, +L. Feel free to fork and contribute, or +to clone L and send patches! + +Patches against Pod::Simple are welcome. Please send bug reports to +. + =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -715,12 +754,22 @@ merchantability or fitness for a particular purpose. =head1 AUTHOR -Sean M. Burke C +Pod::Simple was created by Sean M. Burke . +But don't bother him, he's retired. -=cut +Pod::Simple is maintained by: + +=over + +=item * Allison Randal C +=item * Hans Dieter Pearcey C +=item * David E. Wheeler C +=back + +=cut JUNK: sub _old_get_title { # some witchery in here