sub split_array_in_two { my $len = int($#_/2); return unless ( @_ ); return [ @x[0..$len] ], [ @x[$len+1..$#x] ]; }