# remove empty array refs @arrays = ( [], [1], [ 1, 2 ], [], [ 5 .. 9 ] ); # @filled = ( [1], [ 1, 2 ], [ 5 .. 9 ] ); @filled = grep +()= @$_, @arrays;