in reply to Removing Items from an Array

@array = grep { foo($_) } @array;

Update: If you want @array to contain only the items that return true, then this is fine. If you want to do some things if true and some other things if false, then stick with your original code.