for $i ( 0 .. $#successarray ) { if ($successarray[$i]->{'ydayopen'} > $fromopenmove) { delete $successarray[$i]; } }