use strict; my $var = 4; sub foo { $var = 'bar'; } foo; print $var;