use strict; &f; #"pre=> ", "post=>2" my $v = 1; &f; #pre=>1", "post=>3" exit; sub f { print "pre=>$v\n"; $v += 2; print "post=>$v\n"; }