##
$ perl -wMstrict -e 'my $x; print "yes" if $x=~/foo/'
Use of uninitialized value $x in pattern match (m//) at -e line 1.
$ perl -wMstrict -e 'my $x; print "yes" if defined $x && $x=~/foo/'
$
####
$ perl -wMstrict -e 'my $x; print "yes" if defined $x && length $x'
$ perl -wMstrict -e 'my $x; print "yes" if length $x'
$