You should do local @f = @f; $f[2] = 9; ... instead of local @f[2] = 9; ~/perl-5.10.0 GMT $ ./perl -le'@f=(1,2,3,4);{local @f = @f; $f[2]=9;print @f;print $#f;$#f=1;print @f;print $#f}print @f;print $#f' 1294 3 12 1 1234 3 Something related can be found here: http://rt.perl.org/rt3/Public/Bug/Display.html?id=10041 On Do. 30. Okt. 2008, 03:02:20, thg@hafro.is wrote: > Here is a one liner to demonstrate the bug: > > perl -e'$\="\n";@f=(1,2,3,4);{local @f[2]=9;print @f;print > $#f;$#f=1;print @f;print $#f}print @f;print $#f' > 1294 > 3 > 12 > 1 > 123 > 2 > > perl -V output is in attachment. > > I do not have the expertise to suggest how to fix the perl code. > > Best wishes > > Th.G. > >Thread Previous