use v5.12;
use warnings;

package TEST::Tie;
require Tie::Hash;
use Carp;
use Data::Dump;
use Scalar::Util qw/reftype blessed/;

our @ISA = qw(Tie::ExtraHash);

sub FETCH {
    #ddx \@_;
    my $class = blessed $_[0];
    #warn tied %{$_[0][1]};
    #warn "untie: ",
      untie %{$_[0][1]};
    my $val ="<".$_[0][1]->{$_[1]}.">";
    #warn "tie: ",
      tie %{$_[0][1]}, $class, $_[0][1];
    #warn tied %{$_[0][1]};
    return $val;
    
}

# sub TIEHASH {
#     ddx \@_;
#     die
# }

package main;
use Data::Dump;

my %h;
@h{"a".."c"}= 40..42;

my $x = tie %h, "TEST::Tie", \%h;
#ddx $x;

#ddx tied %h;


say $h{a};
say @h{qw/a b c/};
