From: Gisle Aas Date: Fri, 6 Jan 2006 10:38:37 +0000 (+0000) Subject: Improve description of the -s switch. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=74ac850a5ee417afa60a477ea52af7a8f46a7e5a;p=p5sagit%2Fp5-mst-13.2.git Improve description of the -s switch. I found the "This means you can have switches with two leading dashes." sentence introduced by change 7144 really confusing. The note after the example should make it clear enough that double dash switches can be used for those that insist. p4raw-id: //depot/perl@26669 --- diff --git a/pod/perlrun.pod b/pod/perlrun.pod index 6eb6bbf..ee35b11 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -771,8 +771,7 @@ X<-s> enables rudimentary switch parsing for switches on the command line after the program name but before any filename arguments (or before -an argument of B<-->). This means you can have switches with two leading -dashes (B<--help>). Any switch found there is removed from @ARGV and sets the +an argument of B<-->). Any switch found there is removed from @ARGV and sets the corresponding variable in the Perl program. The following program prints "1" if the program is invoked with a B<-xyz> switch, and "abc" if it is invoked with B<-xyz=abc>. @@ -780,7 +779,7 @@ if it is invoked with B<-xyz=abc>. #!/usr/bin/perl -s if ($xyz) { print "$xyz\n" } -Do note that B<--help> creates the variable ${-help}, which is not compliant +Do note that a switch like B<--help> creates the variable ${-help}, which is not compliant with C. Also, when using this option on a script with warnings enabled you may get a lot of spurious "used only once" warnings.