sub foo { my $static = 42 if 0; print "static is now $static\n"; $static++; } foo() for 1..5; #### static is now static is now 1 static is now 2 static is now 3 static is now 4