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
In reply to Re: how to avoid using index of array
by clueless newbie
in thread how to avoid using index of array
by Achilles_Sea
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |