in reply to Easier Way?

Your if case isn't necessary, if you increment an nonexistant hash element it is autocreated for you. Also, the sort is superfluous since the order in which you look at your keys makes no difference to their count. And lastly, as has been pointed out, since you don't use the keys for anything else than to access the values, just use values rather than keys. For code, see Arien's post.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: Easier Way?
by abitkin (Monk) on Aug 28, 2002 at 22:00 UTC
    Wow.

    Very nice, this gives me a little insight into perl that I had missed.
    Thanks so much.
      My pleasure. :-)

      Makeshifts last the longest.