@sorted = sort { $a->{key2} cmp $b->{key2} || $a->{num1} <=> $b->{num1} || $a->{key3} cmp $b->{key3} || } @data;