{ my $q; BEGIN { # runs at compile time when the outer block hasn't been entered $q = 42; } print $q; # prints 42 }