Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

RE: RE: hashes

by jrsmith (Pilgrim)
on May 31, 2000 at 21:58 UTC ( #15662=note: print w/ replies, xml ) Need Help??

in reply to RE: hashes
in thread hashes

i need the values to be printed out in that exact order, and if i didn't specify the keys they would be random..

Comment on RE: RE: hashes
Replies are listed 'Best First'.
RE: RE: RE: hashes
by KM (Priest) on May 31, 2000 at 22:02 UTC
    print OUT $hash{key1}; print OUT $hash{key2}; etc...

    If you want them in a specific order, use them in that specific order. Or do something like:

    my @keys = ('one', 'two', 'three'); for (@keys) { print OUT $hash{$_}; }

    Then, you have already predetermined your order, and can add/change it at any time.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2015-12-01 04:36 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 (794 votes), past polls