develooper Front page | perl.perl5.porters | Postings from July 2001

Re: [Help] Salvage the Array Hash Monster.

Thread Previous | Thread Next
Sam Tregar
July 26, 2001 20:39
Re: [Help] Salvage the Array Hash Monster.
Message ID:
On Fri, 27 Jul 2001, Autrijus Tang wrote:

> I'm aware that one can overload deferencing operators for @{} and
> %{} constructs, but that's inadequate for slice access and other
> circumstances.

That's what tie is for.  Your object can store the two tied objects - the
array tie and the hash tie.  Then you can dispatch to the appropriate
object when ->[] or ->{} is called.

Is there some reason this doesn't work?  I'd like to know about it since
I'm planning to do something very similar for associative lists in  Users should be able to access them as lists and as hashes, so
I'll have two tied objects per assoc list and use the appropriate one
depending on the method called.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About