Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

(Guildenstern) Re: Getting keys of a hash element

by Guildenstern (Deacon)
on Jan 25, 2001 at 00:22 UTC ( [id://54111]=note: print w/replies, xml ) Need Help??


in reply to Getting keys of a hash element

I'm unsure what kind of hash you have here. If you're wanting to get the keys of %tophash in sorted order, try this:
foreach my $value (sort keys %tophash) { print $value; }


If, on the other hand $tophash{$subhash} is a reference to a hash, you'll need to do something like this:
foreach my $value (sort keys %{$tophash{$subhash}}) { print $value; }


Guildenstern
Negaterd character class uber alles!

Replies are listed 'Best First'.
Re: (Guildenstern) Re: Getting keys of a hash element
by Mandor (Pilgrim) on Jan 25, 2001 at 00:32 UTC
    It was the 2nd one and it worked perfectly. Thanks!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-23 22:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found