]> git.vpit.fr Git - perl/modules/Variable-Temp.git/blob - t/10-lexical.t
This is 0.01
[perl/modules/Variable-Temp.git] / t / 10-lexical.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Variable::Temp 'temp';
7
8 use Test::More tests => 7;
9
10 my $x = 1;
11 is $x, 1;
12 {
13  temp $x = 2;
14  is $x, 2;
15  $x = 3;
16  is $x, 3;
17  {
18   temp $x = 4;
19   is $x, 4;
20   temp $x = 5;
21   is $x, 5;
22  }
23  is $x, 3;
24 }
25 is $x, 1;