in reply to Creating a Hash from Two Arrays
Untested but should give you an idea. You'll end up with a hash or arrays keyed by the different switches.my %opts; foreach (@switches) { # init the array for each $opts{$_} = []; } my $curswitch = ''; foreach (@values) { $curswitch = $_ and next if exists $opts{$_}; push @{$opts{$curswitch}}, $_; }
-- Dan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating a Hash from Two Arrays
by Aristotle (Chancellor) on Sep 18, 2002 at 19:55 UTC |