my $static = 42 if 0; #### qwurx [shmem] ~ > perl -MO=Deparse sub foo { my $static = 42 if 0; print "static is now $static\n"; $static++; } foo() for 1..5; __END__ sub foo { '???'; print "static is now $static\n"; $static++; } ; foo foreach (1 .. 5); __DATA__ - syntax OK