http://www.perlmonks.org?node_id=124982


in reply to Removing empty string elements from an Array

The above suggestion was great. Here's a more readable, and less efficient version:
my @newArray; foreach my $element ( @array ) { push $element, @newArray if $element; }
This should push everything you want into @newArray. It's a bit slower than the grep solution, and has additional overhead of using another array; but I find it easier to read.