in reply to Dealing with Hash Table

Keep an array of the current top 20 as you read the values in.

That said, depending on the nature of the data and what else you are doing with it, you may be better off using a database such as DBD::SQLite.

True laziness is hard work

Replies are listed 'Best First'.
Re^2: Dealing with Hash Table
by ŞuRvīvőr (Novice) on Aug 07, 2011 at 13:04 UTC

    I have done the following ...

    @keys = sort {$Top_Twenty_Categories{$b} <=> $Top_Twenty_Categories{$a +}} keys %Top_Twenty_Categories; foreach $key (@keys) { $key: $Top_Twenty_Categories{$key}\n"; }

    And it's working on a sample dataset very well, but I'm trying to find a faster way to do the job; as I'm gonna apply it on a very large dataset.