for my $count ( reverse 0..$#content ) { # do stuff with $content[$count], including splicing it out of existence }