chomp foreach( @array ); @array = grep { length } @array; #grep leaves out all items that have a 'false' length