note
chipmunk
Aside from the issue of readability, which is obviously subjective, this solution will drop any occurences of '0' from the array. A more explicit check is necessary, as in the earlier grep solutions:
<code>my @newArray;
foreach my $element ( @array ) {
push $element, @newArray
if defined $element and $element ne '';
}
</code>
(Personally, I also prefer grep to solve this problem.)
124970
124982