http://qs321.pair.com?node_id=1229544


in reply to Re: Deleting certein elements from an array
in thread Deleting certein elements from an array

Good explanation! However, the original question was to keep the negative elements of the array and thus it should be

@rand = grep { $_ < 0 } @rand;