$hash->clear;
to:
%$hash = ();
This class lets you do both, if you turn on the clear method--by default $hash->clear will just return the value of $hash->{clear}. That is, if you don't like the additional methods, you don't turn them on. If you like the additional methods, but you aren't real fond of the named accessors using AUTOLOAD, turn the methods and the accessors off. Still further, if something has been turned off and you still want to use the functionalty use the Class::Hash syntax or use the hash directly. I think this module just takes hashes to a new level of TMTOWTDI.
Cheers, Sterling
Kurt Starsinic wrote:
On Aug 18, Perl Authors Upload Server wrote:--
The following module was proposed for inclusion in the Module List:
modid: Class::Hash DSLIP: adpOp description: An object-orient wrapper for hashes. userid: HANENKAMP (Andrew Sterling Hanenkamp) chapterid: 6 (Data_Type_Utilities) communities:
similar: Class::Struct
rationale:
Essentially, I've just wrapped a hash in an object-orient
interface.
How is this different from a tied hash? In what situations is it useful?
- Kurt
-- <>< ><> <>< ><> <>< ><> <>< ><> <>< ><> <>< ><> <>< ><> <>< ><> <>< ><> Andrew Sterling Hanenkamp http://Andrew.Sterling.Hanenkamp.com/ [EMAIL PROTECTED] / [EMAIL PROTECTED]
"When an opponent declares, 'I will not come over to your side,' I calmly say, 'Your child belongs to us already...What are you? You will pass on. Your descendants, however, now stand in the new camp. In a short time they will know nothing else but this new community.'" -- Adolf Hitler, on public education.