In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/6e8135a4380966ca56b30d95854b54dc8d9c08d4?hp=9ef15e2cb2f63e1ce45bd222471285ab7bc091ef>
- Log ----------------------------------------------------------------- commit 6e8135a4380966ca56b30d95854b54dc8d9c08d4 Author: Harald Jörg <[email protected]> Date: Sun Oct 29 09:41:59 2017 -0400 Show that '/o' modifier no longer has adverse effects on 'split'. The underlying problem was already fixed in 3cb4cde3dd4d2af2f5065053905708bffa5168f9 (Jul 4 2017). For clarity, adding test adapted from original poster in RT 132334. Add Harald Jörg to Perl AUTHORS. ----------------------------------------------------------------------- Summary of changes: AUTHORS | 1 + t/op/split.t | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index b3c81b021a..c8cb6836bf 100644 --- a/AUTHORS +++ b/AUTHORS @@ -486,6 +486,7 @@ Hans Dieter Pearcey <[email protected]> Hans Ginzel <[email protected]> Hans Mulder <[email protected]> Hans Ranke <[email protected]> +Harald Jörg <[email protected]> Harmen <[email protected]> Harmon S. Nine <[email protected]> Harri Pasanen <[email protected]> diff --git a/t/op/split.t b/t/op/split.t index 038c5d7481..b25d6cbf4c 100644 --- a/t/op/split.t +++ b/t/op/split.t @@ -7,7 +7,7 @@ BEGIN { set_up_inc('../lib'); } -plan tests => 172; +plan tests => 176; $FS = ':'; @@ -244,7 +244,7 @@ is($cnt, scalar(@ary)); } { - # bug id 20000427.003 (#3173) + # bug id 20000427.003 (#3173) use warnings; use strict; @@ -651,3 +651,19 @@ is "@a", '1 2 3', 'assignment to split-to-array (stacked)'; fresh_perl_is(<<'CODE', '', {}, "scalar split stack overflow"); map{int"";split//.0>60for"0000000000000000"}split// for"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" CODE + +# RT #132334: /o modifier no longer has side effects on split +{ + my @records = ( + { separator => '0', effective => '', text => 'ab' }, + { separator => ';', effective => ';', text => 'a;b' }, + ); + + for (@records) { + my ($separator, $effective, $text) = @$_{qw(separator effective text)}; + $separator =~ s/0//o; + is($separator,$effective,"Going to split '$text' with '$separator'"); + my @result = split($separator,$text); + ok(eq_array(\@result,['a','b']), "Resulting in ('a','b')"); + } +} -- Perl5 Master Repository
