$_ = 'fred'; my $i = 123; { local *_ = \$i; for $i ( 1 .. 5 ) { print $i; } } print "\$_:$_ \$i:$i" 1 2 3 4 5 $_:fred $i:123