in reply to Faster way to do this?
If you put the match in list context with (), it will return the matches which you can count and discard with a scalar context like this:
$count = () = /(M+)/g;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Faster way to do this?
by stevieb (Canon) on Nov 12, 2015 at 16:39 UTC |
In Section
Seekers of Perl Wisdom