use strict; use warnings; my $undef; my $non_numeric_str = 'abc'; print "it's 0\n" if $undef == 0; print "it's 0\n" if $non_numeric_str == 0;