c:\@Work\Perl\monks>perl -wMstrict -le "my $x; ;; S('A'); ;; $x = 'foo'; ;; S('B'); ;; sub S { print qq{$_[0]: x is }, defined $x ? qq{'$x'} : 'undefined'; } " A: x is undefined B: x is 'foo'