our $people = 10; our $prizes = 8; our $draws = 22*2; my @save_args; while (@ARGV) { if ($ARGV[0] eq '-people') { shift @ARGV; if (@ARGV) { my $temp = shift @ARGV; if (($temp > 0) and ($temp < 1e6)) { $people = $temp; } else { die "Error: -people out of range, <$temp>, " } } else { die "Error: -people, no value, " } next; } # etc. }