in reply to Compare complex perl data structures

At first glance, your @array1 and @array2 will each be single element arrays containing an array reference because you have used square brackets rather than parentheses. Do either

my @array1 = ( ... );

or

my $refToArray1 = [ ... ];

I've not looked beyond that but in each case you are trying to sort single elements which is probably not what you want.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^2: Compare complex perl data structures
by AnishaM (Acolyte) on Oct 16, 2016 at 12:40 UTC
    Thanks so much for replying Johngg.These arrays were being returned by another function. I got your point. Will try modifying the other function.