{ my $x; sub foo { return ++$x; } } for (1..7) { print foo() }