$hash{keylvl1}{keylvl2} #### package Tie::HashDF; use strict; BEGIN { require Exporter; require Tie::Hash; @Tie::HashDF::ISA = qw(Exporter Tie::StdHash); @Tie::HashDF::EXPORT = qw(); } sub tolog { print "$_[0] : $_[1]\n"} sub TIEHASH { my $self = bless {}, shift; return $self } sub FETCH { tolog 'FETCH', "$_[1] : $_[0]{$_[1]}"; $_[0]{$_[1]} } sub STORE { tolog 'STORE'; } 1; #### #!/usr/bin/perl use strict; use lib '/work/lib'; use Tie::HashDF; my $obj = tie my %hash, 'Tie::HashDF'; #my $a = $hash{toby}{ip}; $hash{toby}{ip} = '111'; $hash{drago}{account} = 'halo'; #undef $obj; #untie %hash; #### FETCH : toby : HASH(0x821a9a0) FETCH : drago : HASH(0x81433fc) #### FETCH : toby : HASH(0x821a9dc) FETCH : toby : HASH(0x821a9dc) FETCH : drago : HASH(0x8143520)