use strict; use warnings; sub function { my $i = 0; sub test { print ++$i,"\n"; } test(); test(); }