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