That's nasty :)
It's much simpler using Tie::StdHash as you only need to implement the methods that you want to override.
package Tie::Hash::ExpandingHash; use strict; use warnings; use Tie::Hash; our @ISA = 'Tie::StdHash'; sub CLEAR { } # NOT IMPLEMENTED sub FORCE_CLEAR { %{$_[0]} = () }
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re^3: Assign (key, value) to a hash w/o clobbering hash
by davorg
in thread Assign (key, value) to a hash w/o clobbering hash
by Melly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |