On Wed, Aug 16, 2000 at 04:41:33PM +0100, Graham Barr wrote:
> On Wed, Aug 16, 2000 at 10:20:28AM -0500, Jonathan Scott Duff wrote:
> > > m//gt would be defined to do the match, and return the count of matches, this 
> > > leaves all existing uses consistent and unaffected.  /t is suggested for
> > > "counT", as /c is already taken.  Using /t without /g would be result in
> > > only 0 or 1 being returned, which is nearly the existing syntax.
> > 
> > Better would be to redefine what m//g means in a scalar context. 
> > 
> >     $_ = "foofoofoofoofoofoofoo";
> >     $count = m/foo/g;
> > 
> > 1 is just as true as 7.
> 
> But you would loose the functionality of \G starting where the last match
> left off. This is very useful.

/gg to "count 'em all"? :-)

> Graham.

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Reply via email to