in reply to Re: Tutelage, part two
in thread Tutelage, part two

print join( '', map( "$_: $word_count{$_}\n", @gt_three_char_words[ 0 .. 9 ] ) ) . "\n";
No offense intended, but that is truly ugly. Why not a simple for loop:
for my $word (@gt_three_char_words[ 0 .. 9]) { print "$word: $word_count{$word}\n"; }
Now here is how I would have written the entire thing.
You've got a couple of errors there: $word where you meant $_ in the increment loop and an extraneous ( after split.

Replies are listed 'Best First'.
Re: Re: Re: Tutelage, part two
by diotalevi (Canon) on Jan 04, 2004 at 20:30 UTC
    Ugly? Huh. I thought the foreach/print was uglier than the print/map. But then on consideration I would have probably written that as as list instead.
    print +(map "$_: $word_count{ $_ }\n", @gt_three_char_words[ 0 .. 9 ] ), "\n";