Changeset 1239
- Timestamp:
- 2000-06-26T14:28:03+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/parsargv.pm
r1225 r1239 64 64 # Returns 0 if there was an error, nonzero otherwise. 65 65 # 66 sub parse 66 67 68 sub parse 67 69 { 68 70 my $arglist = shift; … … 70 72 my %option; 71 73 74 <<<<<<< parsargv.pm 75 my @rest = @_; 76 77 # if the last argument is the string "allow_extra_options" then options 78 # in \@rest without a corresponding SPEC will be ignored (i.e. the "$arg is 79 # not a valid option" error won't occur)\n"; 80 my $allow_extra_options = pop @rest; 81 if (defined ($allow_extra_options)) { 82 if ($allow_extra_options eq "allow_extra_options") { 83 $allow_extra_options = 1; 84 } else { 85 # put it back where we got it 86 push (@rest, $allow_extra_options); 87 $allow_extra_options = 0; 88 } 89 } else { 90 $allow_extra_options = 0; 91 } 92 93 while (($spec, $var) = splice(@rest, 0, 2)) 94 { 95 ======= 72 96 # if the last argument is the string "allow_extra_options" then options 73 97 # in \@_ without a corresponding SPEC will be ignored (i.e. the "$arg is … … 88 112 while (($spec, $var) = splice(@_, 0, 2)) 89 113 { 114 >>>>>>> 1.3 90 115 die "Variable for $spec is not a valid type." 91 116 unless ref($var) eq 'SCALAR' || ref($var) eq 'ARRAY';
Note:
See TracChangeset
for help on using the changeset viewer.