my $var; BEGIN { $var = "some value"; } BEGIN { ... code that uses for $var ... }