in reply to how to avoid using index of array
printsuse strict; use warnings; my @guys=qw(Tom Dick Harry); my @gals=qw(Jane Mary Pamela); # The real work ... my %marriages; @marriages{@guys}=@gals; for my $guy (keys %marriages) { print "$guy - $marriages{$guy}\n"; }
Dick - Mary Harry - Pamela Tom - Jane
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to avoid using index of array
by TomDLux (Vicar) on Nov 14, 2011 at 02:48 UTC | |
by Anonymous Monk on Jun 13, 2012 at 03:30 UTC |