summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2021-06-28 06:04:50 +0000
committerNicholas Clark <nick@ccl4.org>2021-06-30 09:40:13 +0000
commitc683824536c9806b1b970459bf81690e006b59ae (patch)
tree37a77f4d33e2e7c69b3b4c4872c02a3778e60c22 /pod
parent0bbac695ec3a38c073796ecad0e608d9a0629a65 (diff)
downloadperl-c683824536c9806b1b970459bf81690e006b59ae.tar.gz
State that the -s command line switch is discouraged; mention Getopt::Long
We really should discourage the use of -s. Also clarify that the variables are created in the main package. It's not obvious whether this is obvious - implying that it needs saying.
Diffstat (limited to 'pod')
-rw-r--r--pod/perlrun.pod5
1 files changed, 3 insertions, 2 deletions
diff --git a/pod/perlrun.pod b/pod/perlrun.pod
index dfefeb5beb..f3b8c860d9 100644
--- a/pod/perlrun.pod
+++ b/pod/perlrun.pod
@@ -762,7 +762,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<-->). Any switch found there is removed from @ARGV and sets the
-corresponding variable in the Perl program. The following program
+corresponding variable in the Perl program, in the main package. 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>.
@@ -772,7 +772,8 @@ if it is invoked with B<-xyz=abc>.
Do note that a switch like B<--help> creates the variable C<${-help}>, which is
not compliant with C<use strict "refs">. Also, when using this option on a
script with warnings enabled you may get a lot of spurious "used only once"
-warnings.
+warnings. For these reasons, use of B<-s> is discouraged. See L<Getopt::Long>
+for much more flexible switch parsing.
=item B<-S>
X<-S>