my @items = ( 0..5 ); my $index = 0; for my $value (@items) { print "testing $value\n"; if ( $value == 1 or $value == 3 ) { print "removed value $value\n"; splice @items, $index, 1; } $index++; }