Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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,

Comment on Re: array and hash
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2015-11-25 23:48 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (693 votes), past polls