my $foo = "bar"; sub foo { # It's ok to use $foo here in a normal script, # but it may have strange results under mod_perl print $foo; }