sub foo { my $x; $x++; return $x; } print foo() for (0 .. 10);