note
truedfx
Just to have it mentioned: another way to do it is given in <code>perldoc -f scalar</code>:
<code>
#!perl -l
my $str = "here are some words";
my $count = @{[ $str =~ /\S+/g ]};
print $count;
</code>
Personally, I think this makes the meaning clearer, but I'm sure others may disagree.
527973
527973