On Jun 24 2001, Brett W. McCoy wrote:
> m//g *does* return the number of matches
> if you use it in the correct context (as we have already discussed to
> death...).
I'm a Perl newbie that has just joined this list to aid me in
my Perl education and, following this discussion, I think that
I have two questions:
1 - How does the Perl grammar interprets the following statements:
$n = () = m/string/g;
In particular, is "()" an lvalue in Perl?
2 - Why does the following snippet prints 3 and not 4?
$_ = "ana e mariana gostam de banana";
$n = () = m/ana/g;
print "$n\n";
Perl seems to not be finding occurences of overlapped
patterns (as I would expect from the implementation of a
Boyer-Moore algorithm -- which I read somewhere that Perl
uses when dealing with simple patterns).
Any help will be very much appreciated.
Thank you very much, Roger...
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rog�rio Brito - [EMAIL PROTECTED] - http://www.ime.usp.br/~rbrito/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- determining largest in a set of variables Aaron Lawson
- Re: determining largest in a set of variables Brett W. McCoy
- Re: determining largest in a set of variables Paul Johnson
- Re: determining largest in a set of variables Jeff 'japhy' Pinyan
- How do I determine number of matches in a regex? Bradford Ritchie
- Re: How do I determine number of matches in a... Brett W. McCoy
- Re: How do I determine number of matches ... Bradford Ritchie
- Re: How do I determine number of matc... Brett W. McCoy
- Re: How do I determine number of... Rog�rio Brito
- Re: How do I determine numbe... Michael Fowler
- Re: How do I determine n... Rog�rio Brito
- Re: How do I determine n... Michael Fowler
- With perl, don't expect consiste... Me
- Re: With perl, don't expect ... Brett W. McCoy
- Re: How do I determine number of matches in a... Jeff 'japhy' Pinyan
- Re: How do I determine number of matches ... Chas Owens
- Re: How do I determine number of matc... Jeff 'japhy' Pinyan
