in reply to Re: simple tie?
in thread simple tie?
Good answer, Beatnik! Allow me to suggest a simplification to your solution. Use SUPER;) and you don't need the TIEHASH routine.
Package Tie::Hash::SaveConfig; @ISA = qw(Tie::StdHash); use strict; sub STORE { my $self = shift; SaveConfig(); $self->SUPER::STORE(@_); # or (probably better) here: # SaveConfig(); } sub SaveConfig { # do something ... print "Config saved\n"; } 1;
Update: Note merlyn's comment below. I put an additional comment into the code. From the original post, though, it's not clear what is actually wanted.
-- Hofmator
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Re: Re: simple tie?
by merlyn (Sage) on May 27, 2002 at 13:37 UTC | |
by L0rdPhi1 (Sexton) on May 27, 2002 at 16:17 UTC | |
by demerphq (Chancellor) on May 27, 2002 at 17:20 UTC | |
|
Re: Re: Re: simple tie?
by Beatnik (Parson) on May 27, 2002 at 13:24 UTC |