FAQ

On Tue, May 31, 2016 at 09:06:57AM -0700, Smylers wrote:
# New Ticket Created by Smylers
# Please include the string: [perl #128302]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=128302 >



This is a bug report for perl from smylers@stripey.com,
generated with the help of perlbug 1.40 running under perl 5.25.2.


-----------------------------------------------------------------
perldoc -f split doesn't state that split /PATTERN/ can use pattern
modifier flags, but it seems that it can:

./perl -Ilib -E 'say foreach split /a b # c/, q[0aB1a b # c2a B # c 3]'
0aB1
2a B # c 3

./perl -Ilib -E 'say foreach split /a b # c/ix, q[0aB1a b # c2a B # c 3]'

1a b # c2a B # c 3

This should be included in split's documention.

Are all the qr/PATTERN/ flags also valid on split? (With the already
documented exception that /^/ implies /^/m anyway.)

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.
   $


But I haven't checked all of them.



Abigail

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 5 | next ›
Discussion Overview
groupperl5-porters @
categoriesperl
postedMay 31, '16 at 4:07p
activeMay 31, '16 at 9:16p
posts5
users3
websiteperl.org

People

Translate

site design / logo © 2018 Grokbase