You can shorten your while loop:
$counter{$_}++ while chomp($_ = <>) && !/^done$/i;
I threw in !/^done$/i to terminate on "Done", "DONE", etc.
And note the subtle suggestion of others to change $words to $word, which is clearer.
In reply to Re^3: 2 newby questions
by hbm
in thread 2 newby questions
by Socrates440
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |