Perldoc tiny patch to avoid $0
authorIlya Zakharevich <ilya@math.ohio-state.edu>
Mon, 28 Jul 1997 04:23:32 +0000 (16:23 +1200)
committerTim Bunce <Tim.Bunce@ig.co.uk>
Fri, 5 Sep 1997 00:00:00 +0000 (00:00 +0000)
Editing $0 may be not-so-portable.

Enjoy,

p5p-msgid: 199709122141.RAA16846@monk.mps.ohio-state.edu

utils/perldoc.PL

index 38ea9ee..0f43c36 100644 (file)
@@ -45,10 +45,11 @@ print OUT <<'!NO!SUBS!';
 # the perl manuals, though it too is written in perl.
 
 if(@ARGV<1) {
-        $0 =~ s,.*/,,;
+       $me = $0;               # Editing $0 is unportable
+        $me =~ s,.*/,,;
        die <<EOF;
-Usage: $0 [-h] [-v] [-t] [-u] [-m] [-l] PageName|ModuleName|ProgramName
-       $0 -f PerlFunc
+Usage: $me [-h] [-v] [-t] [-u] [-m] [-l] PageName|ModuleName|ProgramName
+       $me -f PerlFunc
 
 We suggest you use "perldoc perldoc" to get aquainted 
 with the system.