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;
15 tie my %t, 'Tie::StdHash';
18 my $wiz = wizard fetch => sub { 0 },
26 print "Using Variable::Magic ", $Variable::Magic::VERSION, "\n";
30 'tie' => sub { $t{a} },
31 'v::m' => sub { $v{a} }
36 'tie' => sub { $t{a} = 2 },
37 'v::m' => sub { $v{a} = 2 }
42 'tie' => sub { exists $t{a} },
43 'v::m' => sub { exists $v{a} }
46 print "Delete/store:\n";
48 'tie' => sub { delete $t{a}; $t{a} = 3 },
49 'v::m' => sub { delete $v{a}; $v{a} = 3 }