X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=Hash%2FSub.pm;h=daadf2afa4d127aaee45fa11328056431fd0fb35;hb=b7a13090b7f4a4ee4539f9a5e7019c809557a545;hp=cde07be5f0ea0f0714d84fe720eb6aacd7cb7b85;hpb=a6002214271fd33e9c66e8d8b7659756c8917fe9;p=MyWeb.git diff --git a/Hash/Sub.pm b/Hash/Sub.pm index cde07be..daadf2a 100644 --- a/Hash/Sub.pm +++ b/Hash/Sub.pm @@ -21,8 +21,9 @@ our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; our $CVS_ID=q$Id$; use strict; use warnings; -require Tie::Hash; # for Tie::StdHash -our @ISA=qw(Tie::StdHash); +use My::Web; # for &Wrequire +Wrequire 'My::Hash'; +our @ISA=qw(My::Hash); use Carp qw(cluck confess); @@ -30,22 +31,11 @@ sub FETCH($$) { my($this,$key)=@_; - my $val=$this->SUPER::FETCH($key); + my $val=$this->pass("FETCH",$key); return $val if $key=~/_sub$/; # force return $val if !defined $val; # 1-item array is intentional. return $val if "CODE" ne ref $val; return &{$val}($this,$key); } -sub STORE -{ -my($this,$key,$value)=@_; - - return $this->SUPER::STORE($key,$value) if $key!~/_push$/; - my $val_orig=$this->SUPER::FETCH($key); - $val_orig=[] if !defined $val_orig; - $val_orig=[$val_orig] if "ARRAY" ne ref $val_orig; - return $this->SUPER::STORE($key,[@$val_orig,$value]); -} - 1;