diff options
author | Larry Wall <lwall@netlabs.com> | 1991-11-05 09:55:53 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1991-11-05 09:55:53 +0000 |
commit | 55204971972392ce5a252fbbd6d78b1c48ed70e3 (patch) | |
tree | a0fc0fa7a40dae3b455667572b9aac94b020c246 /lib/getopts.pl | |
parent | de3bb51191e884300caf98892ecfcc0ca3ebc09c (diff) | |
download | perl-55204971972392ce5a252fbbd6d78b1c48ed70e3.tar.gz |
perl 4.0 patch 18: patch #11, continued
See patch #11.
Diffstat (limited to 'lib/getopts.pl')
-rw-r--r-- | lib/getopts.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/getopts.pl b/lib/getopts.pl index 4ed3a053f9..6590918016 100644 --- a/lib/getopts.pl +++ b/lib/getopts.pl @@ -6,11 +6,12 @@ sub Getopts { local($argumentative) = @_; - local(@args,$_,$first,$rest,$errs); + local(@args,$_,$first,$rest); + local($errs) = 0; local($[) = 0; @args = split( / */, $argumentative ); - while(($_ = $ARGV[0]) =~ /^-(.)(.*)/) { + while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) { ($first,$rest) = ($1,$2); $pos = index($argumentative,$first); if($pos >= $[) { |