On 03/21/2012 11:40 PM, Shlomi Fish wrote:
On Wed, 21 Mar 2012 23:31:48 +0400
Mendor<men...@yuuzukiyo.net>  wrote:

On 03/21/2012 11:27 PM, Chris Stinemetz wrote:
I would like to count the number of regex match and then move onto the
   next iteration in the loop, I'm not able to get this program to work
as intended.
$count = @{ [ $string =~ /(.*)/ ] };
I thing you need /g here and the more idiomatic way would be:

my $count = () = ($string =~ /$RE/g);

See:

http://www.catonmat.net/blog/secret-perl-operators/#goatse


Of course, I'm wrong, thank you for correction.

--
Regards

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to