8 use lib qw{blib/arch blib/lib};
9 use Variable::Magic qw/wizard cast VMG_UVAR/;
11 use Benchmark qw/cmpthese/;
13 die 'Your perl does not support the nice uvar magic of 5.10.*' unless VMG_UVAR;
17 tie my %t, 'Tie::StdHash';
18 $t{$a[$_]} = $_ for 0 .. $#a;
20 my $wiz = wizard fetch => sub { 0 }, store => sub { 0 };
22 $v{$a[$_]} = $_ for 0 .. $#a;
27 print "Using Variable::Magic ", $Variable::Magic::VERSION, "\n";
29 'tie' => sub { my ($x, $y) = map @a[$x++ % @a], 1 .. 2; my $a = $t{$x}; $t{$y} = $a },
30 'v::m' => sub { my ($x, $y) = map @a[$x++ % @a], 1 .. 2; my $a = $v{$x}; $v{$y} = $a }