you can find discussion related to this issue here: http://www.perl.com/pub/2000/05/p5pdigest/THISWEEK-20000521.html#my_x_if_0;_Trick by the way, this is considered a features, not a bug! :-) -- ___cliff rayman___cliff@genwax.com___http://www.genwax.com/ Ajai Shankar wrote: > 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 > > ajaiThread Previous | Thread Next