#!perl -T

use strict;
use warnings;

use Variable::Temp 'temp';

use Test::More tests => 7;

my $x = 1;
is $x, 1;
{
 temp $x = 2;
 is $x, 2;
 $x = 3;
 is $x, 3;
 {
  temp $x = 4;
  is $x, 4;
  temp $x = 5;
  is $x, 5;
 }
 is $x, 3;
}
is $x, 1;
