use v5.12;
use warnings;
use Data::Dump;

use Tie::Watch;

my $frog = {FROG=>[666,42]};

my $watch = Tie::Watch->new(
    -variable => \$frog,
    -debug    => 1,
    -shadow   => 1,                      
#    -fetch    => [\&fetch, 'arg1', 'arg2', 'argn'],
#    -store    => \&store,
    -destroy  => sub {print "Final value=$frog.\n"},
   );

my %vinfo = $watch->Info;
#say join "\n",keys %vinfo;
#ddx \%vinfo;


#ddx my $args  = $watch->Args(-fetch);


$frog->{a}[0] = 123;


my $val   = $watch->Fetch;
print "val=", $watch->Say($val), ".\n";
$watch->Store('Hello');
$watch->Unwatch;
