in reply to Removing empty string elements from an Array
The above suggestion was great. Here's a more readable, and less efficient version:
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.my @newArray; foreach my $element ( @array ) { push $element, @newArray if $element; }
In Section
Seekers of Perl Wisdom