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 splice(@x, 2, 2, @x[3, 2]) fails #6552
Comments
From @muirCreated by @muirI've found a paticular use of splice fails when applied to a tied Enclosed is a test that illustrates the problem. In the code below, splice(@$x, 2, 2, @$x[3, 2]); behaves differently from ------------ cut here ----------- my $x = [ 'a', 'b', 'c', 'd', 'e' ]; tie @$x, 'OverArray', $x; #print "3,2 = ".join(' ', @$x[3, 2])."\n"; splice(@$x, 2, 2, @$x[3, 2]); #print "x = @$x\n"; print ($x->[3] eq 'c' ? "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 Perl Info
|
From @ap* muir@charm.idiom.com (via RT) <perlbug-followup@perl.org> [2003-06-04 21:02]:
I clearly remember there have been problems with slices read from Inline Patch--- t.pl.orig 2003-06-05 16:50:39.000000000 +0200
+++ t.pl 2003-06-05 16:51:39.000000000 +0200
@@ -33,6 +33,7 @@
sub FETCH
{
+ warn "FETCH @_\n";
my $self = shift;
my ($fake, $real) = @$self;
my $index = shift;
@@ -122,6 +123,7 @@
sub SPLICE
{
+ warn "SPLICE @_\n";
my $self = shift;
my ($fake, $real) = @$self;
my $offset = shift || 0;
-----------------------------------------------------------------
-- Regards, |
From p5p@spam.wizbit.beOn Wed Jun 04 12:29:23 2003, muir@charm.idiom.com wrote:
This was fixed in perl-5.8.6 perl-5.8.5 /tmp/rt-22570.pl perl-5.8.6 /tmp/rt-22570.pl |
p5p@spam.wizbit.be - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#22570 (status was 'resolved')
Searchable as RT22570$
The text was updated successfully, but these errors were encountered: