in reply to hash sorting problems

Ok..... First off, your sort should be something along the lines of sort {$a <=> $b} (keys %sentence_count). (This is known as the spaceship operator.)

My main question, though, is where are you putting the result of the sort?? You have the line (as I read it):
$sentence_count{($Counter)} = $sentence_count{($Counter)}sort by_num (keys (%sentence_count));

This line doesn't make much sense to me. Update your node with the code reformatted, please.

Replies are listed 'Best First'.
Re: Re: hash sorting problems
by little (Curate) on Apr 20, 2001 at 22:20 UTC
    ok, look up perlfunc:sort and read about user defined sorting criteria.

    Have a nice day
    All decision is left to your taste