in reply to Re: Hash problem - Perl noob
in thread Hash problem - Perl noob

# or even shorter, but perhaps a bit unreadable: $wordfreq{$_} for (@phrase);

I think perhaps you meant:

$wordfreq{$_}++ for (@phrase);

Since, after all, it's supposed to count the frequency of each word :)



--chargrill
s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)