use strict; use warnings; my ($test,$test2,$test3); # parens needed for my(LIST) print "$test\n"; ## print nothing if(not defined $test){ $test3 = "GOOD"; # no my, no private but upper scope print "$test3\n" } ## print GOOD print "$test\n"; ## print nothing if (not defined $test2) { print "$test3\n"; # print $test3 from upper scope } ## print GOOD. GOOD is defined on first "if" function. #### Use of uninitialized value $test in concatenation (.) or string at d:/tmp/pm/my.pl line 8. Use of uninitialized value $test in concatenation (.) or string at d:/tmp/pm/my.pl line 15. GOOD GOOD