QuoteC:\WINDOWS\Desktop>perl my $var = 0; sub p { print "$var\n" } foreach (1 .. 4) { $var ^= 1; p; } 1 0 1 0 C:\WINDOWS\Desktop>