in reply to Re^2: Remove empty element.
in thread Remove empty element.

@array = grep { $_ } @array;

This grep also removes array elements that happen to be 0. Use grep { defined && length } instead if you want to have the 0 elements in the result.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^4: Remove empty element.
by pemungkah (Priest) on Jul 15, 2009 at 20:48 UTC
    Good catch - in this case there aren't any, but you're still right. :)