package myhash; require Tie::Hash; @ISA = (Tie::StdHash); sub DELETE { print "in my own delete"; #it should do something more meaningful, this is just a demo } 1; myhash.pl: (a testbed) use myhash; tie %a, 'myhash'; delete $a{"a"};