This is for the book “mastering perl”. There are some code snippets in this book which I think is quite useful, thus I keep a note of them below.
1 2 3
2.my $word_count = () = /(\S+)/g;
It will give out the number of matched items.