push( @next_cell_arr, $protein_matrix[$row][$col+1] );# - note: 'right' cell is first element of array push( @next_cell_arr, $protein_matrix[$row+1][$col+1] );# - note: 'diagonal' cell is second element of array push( @next_cell_arr, $protein_matrix[$row+1][$col] );# - note: 'bottom' cell is third element of array # - debug $arr_len = scalar @next_cell_arr; for( $var = 0; $var < $arr_len; $var++ ){ print $next_cell_arr[$var]; print "\n"; } print "\n\n"; #exit; # - debug # - if all values are equal, then the sequence gets a match of suffers a mismatch (diagonal move), and not a gap penalty. This also saves me from having to compute the max of the three cells my $val1 = $next_cell_arr[0] || die "val1 is undefined!!\n"; my $val2 = $next_cell_arr[1] || die "val2 is undefined!!\n"; my $val3 = $next_cell_arr[2] || die "val3 is undefined!!\n";