Created
September 29, 2016 01:15
-
-
Save petdance/2351aa104bbc2b2a3bd73d25c4c9a2a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use 5.010; | |
require "t/test.pl"; | |
my $i = 2112; | |
ok( $i == 2112, '$i starts at 2112' ); | |
for $i (1..3) { | |
somesub(); | |
} | |
ok( $i == 2112, '$i should go back to 2112 outside of the loop' ); | |
sub somesub { | |
state $n; | |
++$n; | |
ok( $i == $n, '$i is ' . $n ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment