various pod nits identified by installhtml (all fixed except
[p5sagit/p5-mst-13.2.git] / lib / Pod / Usage.pm
index 855dbf0..6e6fb7b 100644 (file)
@@ -1,10 +1,7 @@
 #############################################################################
 # Pod/Usage.pm -- print usage messages for the running script.
 #
-# Based on Tom Christiansen's Pod::Text::pod2text() function
-# (with modifications).
-#
-# Copyright (C) 1994-1999 Tom Christiansen. All rights reserved.
+# Copyright (C) 1996-1999 by Bradford Appleton. All rights reserved.
 # This file is part of "PodParser". PodParser is free software;
 # you can redistribute it and/or modify it under the same terms
 # as Perl itself.
@@ -13,7 +10,7 @@
 package Pod::Usage;
 
 use vars qw($VERSION);
-$VERSION = 1.08;   ## Current version of this package
+$VERSION = 1.090;  ## Current version of this package
 require  5.004;    ## requires this Perl version or later
 
 =head1 NAME
@@ -363,12 +360,21 @@ use strict;
 #use diagnostics;
 use Carp;
 use Exporter;
-use Pod::PlainText;
 use File::Spec;
 
 use vars qw(@ISA @EXPORT);
-@ISA = qw(Pod::PlainText);
 @EXPORT = qw(&pod2usage);
+BEGIN {
+    if ( $] >= 5.005_58 ) {
+       require Pod::Text;
+       @ISA = qw( Pod::Text );
+    }
+    else {
+       require Pod::PlainText;
+       @ISA = qw( Pod::PlainText );
+    }
+}
+
 
 ##---------------------------------------------------------------------------
 
@@ -389,7 +395,7 @@ sub pod2usage {
         ## User passed a ref to a hash
         %opts = %{$_}  if (ref($_) eq 'HASH');
     }
-    elsif (/^[-+]?\d+$/o) {
+    elsif (/^[-+]?\d+$/) {
         ## User passed in the exit value to use
         $opts{"-exitval"} =  $_;
     }
@@ -488,13 +494,13 @@ sub preprocess_paragraph {
     local $_ = shift;
     my $line = shift;
     ## See if this is a heading and we arent printing the entire manpage.
-    if (($self->{USAGE_OPTIONS}->{-verbose} < 2) && /^=head/o) {
+    if (($self->{USAGE_OPTIONS}->{-verbose} < 2) && /^=head/) {
         ## Change the title of the SYNOPSIS section to USAGE
-        s/^=head1\s+SYNOPSIS\s*$/=head1 USAGE/o;
+        s/^=head1\s+SYNOPSIS\s*$/=head1 USAGE/;
         ## Try to do some lowercasing instead of all-caps in headings
         s{([A-Z])([A-Z]+)}{((length($2) > 2) ? $1 : lc($1)) . lc($2)}ge;
         ## Use a colon to end all headings
-        s/\s*$/:/o  unless (/:\s*$/o);
+        s/\s*$/:/  unless (/:\s*$/);
         $_ .= "\n";
     }
     return  $self->SUPER::preprocess_paragraph($_);