i had a problem with hashes...can any one help

ihad a hash with keys and values...

# DEFINE A HASH
%coins = ( "12345" , 91,
           "987658" ,35.5,
           "wer123", 99.8,
                    "456hn",56.4,
                        "34567",78.9,
                        "00000",99.9,
                        "yui345",45.4);

# LOOP THROUGH IT
foreach $value (sort {$coins{$a} cmp $coins{$b} } keys %coins)
{
     print "<$value---> $coins{$value}>\n";
}

so now is hash is printing in sorted order....like
<987658---> 35.5>
<yui345---> 45.4>
<456hn---> 56.4>
<34567---> 78.9>
<12345---> 91>
<wer123---> 99.8>
<00000---> 99.9>

wat i need is for ex if i gave 34567 it has to tell the position of
the hash 4th position...

how can i do that.....


Thanks
Lakshmi Nagandla


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to