http://www.perlmonks.org?node_id=465313


in reply to array and hash

Boy, did you pick the right language. Try:
my %hash; for my $element (@array) { $hash{$element} = <some command>; } ... for $element (@array) { # Keep the same order as the original array print "For $element, output was $hash{$element}\n"; }
This would be much harder in something that wasn't perl.

-- Kirby, WhitePages.com