Actually, no, that puts the match into a scalar context which means that it just returns a "true" or "false" value. However: my $count= ()= $text =~ /g/g; works since an array assignment returns the number of items in the right-hand value when used in a scalar context.
- tye (but my friends call me "Tye")In reply to (tye)Re: how to get the number of times a pattern matched
by tye
in thread how to get the number of times a pattern matched
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |