in reply to Word incidence count

Hai just try this
$str='Hello World!\n Oh poor Yorick, his world I knew well yes I did' +; $n=$str=~s#\w+#$&#gsi; print $n; or @n=$str=~m#\w+#gsi; print scalar(@n);