in reply to Re: hard referencing in hashes?!?
in thread hard referencing in hashes?!?

Thanks! but for my assignment i only have to count all the words in a file. Thats why I used hashes....but i found the powerful use of EXISTS :P. Make life so much easier. Now my problem is sorting the results of each word by acending or decending order.

Replies are listed 'Best First'.
Re: Re: Re: hard referencing in hashes?!?
by DamnDirtyApe (Curate) on Nov 08, 2002 at 04:08 UTC

    Look at using a Schwartzian Transform:

    my @sorted = sort { $b->[1] <=> $a->[1] } map { [ $_, $word_count{$_} ] } keys %word_count ;

    _______________
    DamnDirtyApe
    Those who know that they are profound strive for clarity. Those who
    would like to seem profound to the crowd strive for obscurity.
                --Friedrich Nietzsche
Re: Re: Re: hard referencing in hashes?!?
by BUU (Prior) on Nov 08, 2002 at 03:11 UTC
    generally we use sort