in reply to Re^2: Assign (key, value) to a hash w/o clobbering hash
in thread Assign (key, value) to a hash w/o clobbering hash
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Assign (key, value) to a hash w/o clobbering hash
by reasonablekeith (Deacon) on Sep 28, 2006 at 11:47 UTC |