summaryrefslogtreecommitdiff
path: root/lib/getopts.pl
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1991-11-05 09:55:53 +0000
committerLarry Wall <lwall@netlabs.com>1991-11-05 09:55:53 +0000
commit55204971972392ce5a252fbbd6d78b1c48ed70e3 (patch)
treea0fc0fa7a40dae3b455667572b9aac94b020c246 /lib/getopts.pl
parentde3bb51191e884300caf98892ecfcc0ca3ebc09c (diff)
downloadperl-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.pl5
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 >= $[) {