use strict; use warnings; my @L = ('1', '0', ''); while (@L) { if (my $x = shift @L) { print "\$x is true: <$x>\n"; } elsif (length $x) { print "\$x is false: <$x>\n"; } else { print "\$x is still false<$x>\n"; } # print "$x\n"; # yields a strict error when uncommented }