use strict; use warnings; use 5.010; my @array=("", "jim"," "); foreach my $str (@array) { if ($str) { say "perl considers the string: -->$str<-- to be true."; }else { say "perl considers the string: -->$str<-- to be false."; } } output: perl considers the string: --><-- to be false. perl considers the string: -->jim<-- to be true. perl considers the string: --> <-- to be true.