use warnings; my $var = 0; test(); exit; sub test { $var = 1; }