perl 5.11.6 never happened. Remove the traces of its perldelta.
[p5sagit/p5-mst-13.2.git] / pod / podselect.PL
index 7cff691..7fadd73 100644 (file)
@@ -2,6 +2,7 @@
 
 use Config;
 use File::Basename qw(&basename &dirname);
+use Cwd;
 
 # List explicitly here the variables you want Configure to
 # generate.  Metaconfig only looks for shell variables, so you
@@ -10,11 +11,13 @@ use File::Basename qw(&basename &dirname);
 #  $startperl
 # to ensure Configure will look for $Config{startperl}.
 
-$file = basename($0);
-$file =~ s/\.PL$//i;
+# This forces PL files to create target in same directory as PL file.
+# This is so that make depend always knows where to find PL derivatives.
+$origdir = cwd;
+chdir(dirname($0));
+$file = basename($0, '.PL');
 $file .= '.com' if $^O eq 'VMS';
 
-chdir("pod") or die "Can't chdir to pod: $!";
 open OUT,">$file" or die "Can't create $file: $!";
 
 print "Extracting $file (with variable substitutions)\n";
@@ -35,17 +38,14 @@ print OUT <<'!NO!SUBS!';
 #############################################################################
 # podselect -- command to invoke the podselect function in Pod::Select
 #
-# Derived from Tom Christiansen's pod2text script.
-# (with extensive modifications)
-#
-# Copyright (c) 1996 Bradford Appleton. All rights reserved.
+# Copyright (c) 1996-2000 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.
 #############################################################################
 
 use strict;
-use diagnostics;
+#use diagnostics;
 
 =head1 NAME
 
@@ -98,6 +98,8 @@ L<Pod::Parser> and L<Pod::Select>
 
 =head1 AUTHOR
 
+Please report bugs using L<http://rt.cpan.org>.
+
 Brad Appleton E<lt>bradapp@enteract.comE<gt>
 
 Based on code for B<Pod::Text::pod2text(1)> written by
@@ -111,13 +113,13 @@ use Getopt::Long;
 
 ## Define options
 my %options = (
-        "help"     => 0,
-        "man"      => 0,
-        "sections" => [],
+        'help'     => 0,
+        'man'      => 0,
+        'sections' => [],
 );
 
 ## Parse options
-GetOptions(\%options, "help", "man", "sections|select=s@")  ||  pod2usage(2);
+GetOptions(\%options, 'help', 'man', 'sections|select=s@')  ||  pod2usage(2);
 pod2usage(1)  if ($options{help});
 pod2usage(-verbose => 2)  if ($options{man});
 
@@ -125,8 +127,8 @@ pod2usage(-verbose => 2)  if ($options{man});
 pod2usage(2) if ((@ARGV == 0) && (-t STDIN));
 
 ## Invoke podselect().
-if (@{ $options{"sections"} } > 0) {
-    podselect({ -sections => $options{"sections"} }, @ARGV);
+if (@{ $options{'sections'} } > 0) {
+    podselect({ -sections => $options{'sections'} }, @ARGV);
 }
 else {
     podselect(@ARGV);
@@ -138,3 +140,4 @@ else {
 close OUT or die "Can't close $file: $!";
 chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
 exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
+chdir $origdir;