http://www.perlmonks.org?node_id=11104813


in reply to Re: The error says the value is uninitialized, but it works anyway
in thread The error says the value is uninitialized, but it works anyway

if ($colors[$num] eq $drop[0] or $colors[$num] eq $drop[1]){ + splice (@colors, $num, 1); $num--; } $num++;
Just as a nitpick: I think it's better to
if ($colors[$num] eq $drop[0] or $colors[$num] eq $drop[1]) { splice (@colors, $num, 1); } else { $num++; }
because find it's somehow dopey (for lack of a better word) to decrement just to increment immediately afterwards.
With "else" it's clear that you need to increment only if the condition isn't met.