Cornish, Merrill wrote:
> In list context, m//g returns a list of all matches.  You 
> could count the elements in the list.  

For example, like this:

    $count = () = $string =~ /foo/g;

The assignment to () (empty list) puts the match in list context, and the
scalar assignment then counts how many elements were available to be
assigned to the list. Or something like that. It works, at any rate.

Cheers,
Philip
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to