in reply to Re^4: remove element from 2D array after comparing it with other 2D array
in thread remove element from 2D array after comparing it with other 2D array
my ($highest_match, $highest_match_at_a1idx) = (-1);
You might not have spotted it but this is merely list assignment. The list on the right of the equals sign is assigned to the list on the left, so after this assignment, $highest_match has value -1. Since the left list has 2 elements but the right list has only 1, the second element on the left $highest_match_at_a1idx is undef.
I also a bit confuse with the function of .pp in your code. Does this store the variable somewhere?
No, it's just a pretty printer. See Data::Dump::pp.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: remove element from 2D array after comparing it with other 2D array
by Newbie95 (Novice) on May 03, 2019 at 10:30 UTC |