use warnings; my $str = 'foo'; print "$str\n"; # ok $str = undef; print "$str\n"; # emits "uninitialized" warning