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!