Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: using hash values inside an array.

by Fastolfe (Vicar)
on May 04, 2002 at 15:54 UTC ( [id://164009]=note: print w/replies, xml ) Need Help??


in reply to using hash values inside an array.

While other posters mention the use of keys, I just want to point out that if all you're interested in is the values, you can use the values function to just pull those out:
foreach my $value (values %coords) { printf("%d-%d\n", $value->[0], $value->[1]); }
Also, be sure to remember that hash order is not guaranteed. If you need these things to be ordered based on the hash key, you'll need to use sort in conjunction with keys as in others' examples to accomplish this.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-19 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found