summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-10-26 17:01:07 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-10-26 17:24:56 -0700
commite4e95921cd0fd085a5edf35ae358cd213529e55a (patch)
treecb723485b18f12ca5f0bb66c3a516a8d9ad68cf8 /perlio.c
parent6c7f10b59397fa5a696d553f50ae0abc2bce312c (diff)
downloadperl-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