#!/usr/bin/perl -wT use strict; # only one one of these is an "empty" string right? my @arr = ("", "\n", "dog", "cat"); my @haslength = grep {length} @arr; my @notempty = grep {!/^$/} @arr; print scalar @haslength, " members have length\n"; print scalar @notempty, " members are not \"empty\"\n"; __END__ =head1 OUTPUT 3 members have length 2 members are not "empty"