This one should be a reply to the original poster, but I already deleted
the head of this thread...
I just love "modifiers" (perldoc perlsyn)!
my %wc;
while (<>) {
$wc{$_}++ foreach split;
}
by using perldoc -f split's
If EXPR is omitted, splits the $_ string. If PATTERN is also
omitted, splits on whitespace (after skipping any leading
whitespace).
Fun questions for the beginners to meditate over:
What's the value of $_ after the split line in case you would like
to use it, and why
:-)
--
If we fail, we will lose the war.
Michael Lamertz | +49 221 445420 / +49 171 6900 310
Nordstr. 49 | [EMAIL PROTECTED]
50733 Cologne | http://www.lamertz.net
Germany | http://www.perl-ronin.de
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]