diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-10-26 17:01:07 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-10-26 17:24:56 -0700 |
commit | e4e95921cd0fd085a5edf35ae358cd213529e55a (patch) | |
tree | cb723485b18f12ca5f0bb66c3a516a8d9ad68cf8 /perlio.c | |
parent | 6c7f10b59397fa5a696d553f50ae0abc2bce312c (diff) | |
download | perl-e4e95921cd0fd085a5edf35ae358cd213529e55a.tar.gz |
[perl #123057] Allow split-to-array in lvalue context
In some cases @a=split gets optimised to something akin to split(\@a,
...) or split(..., \@a), so lvalue context applied to it sees a split
op instead of a list assignment. And split can’t be assigned to. So (@a=split//,"foo")=bar() fails. This bug probably goes back to perl
3, when this optimisation was added.
(Actually, the array is usually stowed away in the pushre op that
holds the regular expression, though sometimes it becomes the last
argument.)
Recent commits such as ef7999f have extended this optimisation, so
it happens in more places, and ended up breaking chomp(my @array =
split...).
This commits checks specifically for split-to-array when lvalue con-
text is applied.
Diffstat (limited to 'perlio.c')
0 files changed, 0 insertions, 0 deletions