Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
... sub test { my (@names_all, @email_all); my @name = qw(Joe mary ann pete amy jerry); my @email = qw(joe@test.com mary@test.com ann@nowhere.com pete@here.co +m amy@ok.com jerry@b.com); foreach $names(@names) { push @name_all, $names; } foreach $emails(@email) { push @email_all, $emails; } # need to make a hash instead of sending two arrays, how?? #return \@name_all, \@email; return \@name_all; } my $info = test(); foreach my $all(@$info) { print "\n$all\n"; } ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Returning a hash instead of two arrays help!
by davido (Cardinal) on Jul 30, 2012 at 19:52 UTC | |
|
Re: Returning a hash instead of two arrays help!
by toolic (Bishop) on Jul 30, 2012 at 19:41 UTC | |
|
Re: Returning a hash instead of two arrays help!
by GrandFather (Saint) on Jul 30, 2012 at 20:01 UTC | |
by Anonymous Monk on Jul 31, 2012 at 13:33 UTC | |
by GrandFather (Saint) on Jul 31, 2012 at 22:55 UTC | |
|
Re: Returning a hash instead of two arrays help!
by linuxkid (Sexton) on Jul 31, 2012 at 19:57 UTC |