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
tied SPLICE unshift(@x, shift(@x)) doesn't work #6553
Comments
From @muirCreated by @muirWith a tied array, shift(@x, unshift(@x)) replaces the first element with '1'. There is a similar breakage with This is probably related to perlbug #22570. ------------ cut here ---------------- use strict; print "1..1\n"; my $x = [ 'a', 'b', 'c', 'd', 'e' ]; tie @$x, 'OverArray', $x; unshift(@$x, shift(@$x)); #print "x = @$x\n"; print ($x->[0] eq 'a' ? "ok 1\n" : "not ok 1\n"); package OverArray; sub UNTIE sub DESTROY sub TIEARRAY sub FETCH sub STORE sub FETCHSIZE sub STORESIZE sub EXTEND sub EXISTS sub DELETE sub CLEAR sub PUSH sub POP sub SHIFT sub UNSHIFT sub SPLICE ------------ cut here ---------------- Perl Info
|
From @muirI've narrowed the bug down. Turns out that tied The following illustrates. This probalby means that this bug is unrelated to #22570. -Dave ------------------- cut here --------------- my $x = [ 'a', 'b', 'c', 'd', 'e' ]; tie @$x, 'OverArray', $x; my (@a) = shift(@$x); print ($a[0] eq 2 ? "ok 1\n" : "not ok 1\n"); package OverArray; sub TIEARRAY sub SHIFT ------------------- cut here --------------- |
From @iabynI'm marking this ticket as rejected since it turns out that it's a bug return ($self->SPLICE(0,1))[0]; |
@iabyn - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#22571 (status was 'rejected')
Searchable as RT22571$
The text was updated successfully, but these errors were encountered: