rsiedl has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; my (%hash1, %hash2) = &build_hashes; foreach (keys (%hash1)) { print $_, ":", $hash1{$_}, "\n"; } # end-foreach foreach (keys (%hash2)) { print $_, ":", $hash2{$_}, "\n"; } # end-foreach sub build_hashes { my %hash1 = { 1=>"foo1", 2=>"bar1" }; my %hash2 = { 3=>"foo2", 4=>"bar2" }; return (\%hash1, \%hash2); } # end-sub exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: return multiple hashes from a sub
by monkey_boy (Priest) on Feb 03, 2005 at 14:28 UTC | |
|
Re: return multiple hashes from a sub
by pelagic (Priest) on Feb 03, 2005 at 14:31 UTC | |
|
Re: return multiple hashes from a sub
by chb (Deacon) on Feb 03, 2005 at 14:32 UTC | |
|
Re: return multiple hashes from a sub
by aquarium (Curate) on Feb 03, 2005 at 14:24 UTC |