use strict; use warnings; my $i = 1; my $part2 = sub {print "\nnow its $i"; }; print "\ni is ".$i++; $part2->(); print "\ni is $i";