There is a critter, called the goatse operator, "=()=" that will give the scalar count of the number of matches. You can read about it here: goatse operator. Or just look at the code and play with it..
!/usr/bin/perl -w use strict; my $x = "Finding fiNding fIndinG finding"; my $count = () = $x =~ /finding/ig; print "$count\n"; #prints 4
In reply to Re^3: need help in extending the code
by Marshall
in thread need help in extending the code
by sarvan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |