develooper Front page | perl.perl5.porters | Postings from August 2009

Re: [perl #68804] underscore regex delimiters

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
August 28, 2009 07:37
Subject:
Re: [perl #68804] underscore regex delimiters
Message ID:
20090828143726.GP60303@plum.flirble.org
On Thu, Aug 27, 2009 at 02:03:46PM +0200, demerphq wrote:
> 2009/8/27 Abigail <abigail@abigail.be>:

> The doocumentation should read "non-perl-word, non whitespace delimiter"
> 
> We use "alphhanumeric" fairly regularly when we speak of
> "perl-word-characters" or "identifier" (which cannot be expressed by a
> character class as it cannot start  with a number, yet can end with
> one).
> 
> >
> >
> > But even then, the documentation isn't correct. You *can* use word characters
> > as delimiters:
> >
> >   s _/32__
> >
> > and
> >
> >   s s/32ss
> >
> > are fine.
> >
> > The problem here lies in the tokenization part: the first token of
> > C<< s_/32__ >> is C<< s_ >>, which isn't the substitution operator.
> >
> > In fact, this issue isn't any different from saying you cannot use C<< _ >>
> > as a function argument because you wrote:
> >
> >    C<< func_ >>
> >
> > which isn't parsed as C<< func (_) >> either.
> 
> Right. This is not a bug.

in the implementation.

I think we agree that the documentation needs to be improved.

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About