BEGIN { my $count=0; # static sub counter {$count++} } for (0..9) { print counter(); }