diff options
author | Steve Peters <steve@fisharerojo.org> | 2006-01-23 15:56:34 +0000 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2006-01-23 15:56:34 +0000 |
commit | 9ea6f39eafd431bd5584f346d6c0d04a820f6210 (patch) | |
tree | 7f37ceec286d340af66fda658c7fe9dd3a816af1 /lib | |
parent | 547ba77e482059c5dc0437d27dfca137d5a69911 (diff) | |
download | perl-9ea6f39eafd431bd5584f346d6c0d04a820f6210.tar.gz |
Upgrade to Pod-Simple-3.04
p4raw-id: //depot/perl@26929
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Pod/Simple.pm | 2 | ||||
-rw-r--r-- | lib/Pod/Simple/BlackBox.pm | 18 | ||||
-rw-r--r-- | lib/Pod/Simple/Search.pm | 26 |
3 files changed, 34 insertions, 12 deletions
diff --git a/lib/Pod/Simple.pm b/lib/Pod/Simple.pm index 965243e893..fa85488512 100644 --- a/lib/Pod/Simple.pm +++ b/lib/Pod/Simple.pm @@ -18,7 +18,7 @@ use vars qw( ); @ISA = ('Pod::Simple::BlackBox'); -$VERSION = '3.03'; +$VERSION = '3.04'; @Known_formatting_codes = qw(I B C L E F S X Z); %Known_formatting_codes = map(($_=>1), @Known_formatting_codes); diff --git a/lib/Pod/Simple/BlackBox.pm b/lib/Pod/Simple/BlackBox.pm index 90f5d6cc37..6d7fdba4fb 100644 --- a/lib/Pod/Simple/BlackBox.pm +++ b/lib/Pod/Simple/BlackBox.pm @@ -1901,5 +1901,23 @@ sub pretty { # adopted from Class::Classless } #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + +# A rather unsubtle method of blowing away all the state information +# from a parser object so it can be reused. Provided as a utility for +# backward compatibilty in Pod::Man, etc. but not recommended for +# general use. + +sub reinit { + my $self = shift; + foreach (qw(source_dead source_filename doc_has_started +start_of_pod_block content_seen last_was_blank paras curr_open +line_count pod_para_count in_pod ~tried_gen_errata errata errors_seen +Title)) { + + delete $self->{$_}; + } +} + +#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1; diff --git a/lib/Pod/Simple/Search.pm b/lib/Pod/Simple/Search.pm index 2fcd5da90c..7c652b8ef6 100644 --- a/lib/Pod/Simple/Search.pm +++ b/lib/Pod/Simple/Search.pm @@ -4,7 +4,7 @@ package Pod::Simple::Search; use strict; use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY); -$VERSION = 2.03_01; ## Current version of this package +$VERSION = 3.04; ## Current version of this package BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; } # set DEBUG level use Carp (); @@ -254,22 +254,26 @@ sub _path2modname { my $name = join '::', @m, $shortname; $self->_simplify_base($name); - if ($name eq lc($name) || $name eq uc($name)) { + # On VMS, case-preserved document names can't be constructed from + # filenames, so try to extract them from the "=head1 NAME" tag in the + # file instead. + if ($^O eq 'VMS' && ($name eq lc($name) || $name eq uc($name))) { open PODFILE, "<$file" or die "_path2modname: Can't open $file: $!"; my $in_pod = 0; my $in_name = 0; - while (<PODFILE>) { - chomp; - $in_pod = 1 if m/^=\w/; - $in_pod = 0 if m/^=cut/; + my $line; + while ($line = <PODFILE>) { + chomp $line; + $in_pod = 1 if ($line =~ m/^=\w/); + $in_pod = 0 if ($line =~ m/^=cut/); next unless $in_pod; # skip non-pod text - next if m/^\s*\z/; # and blank lines - next if ($in_pod && m/^X</); # and commands + next if ($line =~ m/^\s*\z/); # and blank lines + next if ($in_pod && ($line =~ m/^X</)); # and commands if ($in_name) { - if( m/(\w+::)?(\w+)/) { + if ($line =~ m/(\w+::)?(\w+)/) { # substitute case-preserved version of name my $podname = $2; - my $prefix = $1; + my $prefix = $1 || ''; $verbose and print "Attempting case restore of '$name' from '$prefix$podname'\n"; unless ($name =~ s/$prefix$podname/$prefix$podname/i) { $verbose and print "Attempting case restore of '$name' from '$podname'\n"; @@ -278,7 +282,7 @@ sub _path2modname { last; } } - $in_name = 1 if m/^=head1 NAME/; + $in_name = 1 if ($line =~ m/^=head1 NAME/); } close PODFILE; } |