(@array1, @array2, @array3, ...)= split; #### sub Sort_File { my @Sort_by = @_; @sorted_array = sort { $a <=> $b || $a cmp $b } Sort_by; for ($x = 0; $x <= @sorted_array; $x++){ for ($y = 0; $y <= @sorted_array; $y++){ if ( $sorted_array[$x] == $Sort_by[$y]) { $index[$x] = $y; print $index[$x],"\n"; } } }