# A self-contained test that shows the correct behavior and doesn't get into print/printf. require "t/test.pl"; my $i = 2112; ok( $i == 2112, '$i starts at 2112' ); my $n; for $i (1..3) { ++$n; ok( $i == $n, '$i is ' . $n . ' inside of the for loop' ); somesub(); } ok( $i == 2112, '$i should go back to 2112 outside of the loop' ); exit 0; sub somesub { ok( $i == $n, '$i is ' . $n . ' in the subroutine' ); } --- via perlbug: queue: perl5 status: open https://rt.perl.org/Ticket/Display.html?id=129757Thread Previous | Thread Next