-
Notifications
You must be signed in to change notification settings - Fork 580
split docs don't mention pattern modifiers #15379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From @SmylersThis is a bug report for perl from Smylers@stripey.com, perldoc -f split doesn't state that split /PATTERN/ can use pattern ./perl -Ilib -E 'say foreach split /a b # c/, q[0aB1a b # c2a B # c 3]' ./perl -Ilib -E 'say foreach split /a b # c/ix, q[0aB1a 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 Flags: Site configuration information for perl 5.25.2: Configured by smylers at Tue May 31 13:40:14 BST 2016. Summary of my perl5 (revision 5 version 25 subversion 2) configuration: @INC for perl 5.25.2: Environment for perl 5.25.2: |
From @AbigailOn Tue, May 31, 2016 at 09:06:57AM -0700, Smylers wrote:
I think they are, but some warn. For instance: $ perl -wE 'our @a = split /f/g, "foo"' But I haven't checked all of them. Abigail |
The RT System itself - Status changed from 'new' to 'open' |
From @SmylersAbigail writes:
/g is an m// modifier. perlop documents that m// takes all of the qr//
I was hoping that somebody might already know, but if not I'll go Smylers |
From @cpansproutOn Tue May 31 13:59:22 2016, smylers@stripey.com wrote:
It does accept all the modifiers that m// accepts, because there is actually an m// op there at compile time initially, before ck_split makes its exotic changes to the op tree. After all, you can write split m//.... -- Father Chrysostomos |
From @cpansproutOn Tue May 31 14:14:16 2016, sprout wrote:
If you do change the docs, please don’t make it imply that split "foo" can take modifiers. split per se does not actually take any, but rather the m// that serves as its first argument. (In fact, the idea of split taking modifiers is not a way I have ever looked at it, even before I knew perl internals.) -- Father Chrysostomos |
From @khwilliamsonThanks for reporting this. I did some investigation, and added the documentation in |
@khwilliamson - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been Perl 5.26.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#128302 (status was 'resolved')
Searchable as RT128302$
The text was updated successfully, but these errors were encountered: