Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: array and hash

by kirbyk (Friar)
on Jun 09, 2005 at 20:38 UTC ( #465313=note: print w/ replies, xml ) Need Help??


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


Comment on Re: array and hash
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://465313]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2014-09-02 11:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (22 votes), past polls