in reply to unshift with two-dimensional arrays

It can be helpful to use Data::Dumper to visualise your data if you are not sure what is going wrong.

use strict; use warnings; use Data::Dumper; my @arrA = ( [0, 1, 2] ); unshift @arrA, 1; print Data::Dumper->Dump([\@arrA], [q{*arrA}]); shift @arrA; unshift @arrA, [1]; print Data::Dumper->Dump([\@arrA], [q{*arrA}]);

This code produces the following.

@arrA = ( 1, [ 0, 1, 2 ] ); @arrA = ( [ 1 ], [ 0, 1, 2 ] );

I hope this is useful.

Cheers,

JohnGG