5 use Variable::Magic qw(wizard cast);
7 BEGIN { package Foo; sub DESTROY { warn "in DESTROY\n"; } }
9 my $wiz = wizard data => sub { $_[1] },
10 free => sub { warn "destroyed $_[1]!\n"; };
14 $objs{foo} = bless({}, 'Foo');
16 cast $objs{foo}, $wiz, '$objs{foo}';