No intermediate hash necessary:
use List::MoreUtils qw( zip ); sub test { my @name = qw( Joe mary ann pete amy jerry ); my @email = qw( joe@test.com mary@test.com ann@nowhere.com pete@he +re.com amy@ok.com jerry@b.com ); return zip @name, @email; }
See List::MoreUtils (mesh or its alias zip). This is also built into Perl6 as (I think), the Z operator.
Dave
In reply to Re: Returning a hash instead of two arrays help!
by davido
in thread Returning a hash instead of two arrays help!
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |