Created
June 1, 2012 16:10
-
-
Save diakopter/2853248 to your computer and use it in GitHub Desktop.
This file contains 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 Test; | |
{ | |
my $depth = 0; | |
my $c = 1; | |
sub a { | |
++temp $c; | |
a() if ++$depth < 3; | |
} | |
a(); | |
is $c, 1, 'recursive nested temps are restored properly'; | |
} | |
{ | |
my $a=1; | |
{ | |
temp $a=2; | |
temp $a=3; | |
} | |
is $a, 1, 'multiple temps in the same scope are restored properly'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment