- or download this
my %opts;
@opts{@switches} = ([]) x @switches;
- or download this
my %opts;
@opts{@switches} = ();
- or download this
my $curswitch;
for (@values) {
exists $opts{$_} ?
...
defined $curswitch or die "Not a switch: $_\n";
push @$curswitch, $_;
}