http://qs1969.pair.com?node_id=11104653


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

Ahh, of course... thanks!

adding "save" array, and "if" to "unless"...

perl -wMstrict -e ' my @colors = qw(red green blue yellow pink purple brown); my @drop = qw(pink purple); my @save = (); while ( my ($num, $val) = each @colors ) { unless ($val eq $drop[0] or $val eq $drop[1]) { push @save, $colors[$num]; } } print "@save \n"; ' __output__ red green blue yellow brown