Hi Why does this behave like a c function static variable? use strict; sub foo() { my $x if 0; print "\$x is $x and ref \$x is " , \$x , "\n"; $x = 1 if !defined $x; } for(1..3) { foo } Thanks ajai