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

Re: [Help] Salvage the Array Hash Monster.

Thread Previous | Thread Next
Autrijus Tang
July 26, 2001 23:18
Re: [Help] Salvage the Array Hash Monster.
Message ID:
Turned out I made a mistake about the overload implementation. Sorry.
Overloading '@{}'/'%{}' does work; I was using @{$_[0]} inside the 
'@{}'overloading code and messed it up.

<> shows that for
the particular case of ArrayHashMonster, the two tied objects don't
even have to belong to different packages -- their FETCH routines
are exactly identical. it's also about 25% faster than the (untuned)
phash implementation:

    4.762u 0.000s 0:05.27 90.3% # AHM2 (phash)
    3.576u 0.046s 0:03.90 92.5% # AHM3 (overload)

I also misunderstood mjd's idea about the proposed patch to core; it's
more along the line of allowing a scalar that holds a GLOB reference to 
behave exactly like *{"sym"} does, so you can assign it hashref and
arrayref and have it act like a natural ArrayHashScalarFunctionMonster,
which I think is a very elegant solution.



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