for (0..9) { my $count = 3; # just to prove a point print counter(); } do { my $count; sub counter {$count++} } __OUTPUT__ 0123456789