develooper Front page | perl.perl5.porters | Postings from May 2016

Re: [perl #128302] split docs don't mention pattern modifiers

Thread Previous | Thread Next
From:
Smylers
Date:
May 31, 2016 20:58
Subject:
Re: [perl #128302] split docs don't mention pattern modifiers
Message ID:
20160531210945.GA12979@stripey.com
Abigail writes:

> On Tue, May 31, 2016 at 09:06:57AM -0700, Smylers wrote:
> 
> > Are all the qr/PATTERN/ flags also valid on split?
> 
> I think they are, but some warn. For instance:
> 
>   $ perl -wE 'our @a = split /f/g, "foo"'
>   Use of /g modifier is meaningless in split at -e line 1.

/g is an m// modifier. perlop documents that m// takes all of the qr//
modifiers plus /g and /c.

> But I haven't checked all of them.

I was hoping that somebody might already know, but if not I'll go
through them.

Smylers

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