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

Re: [Help] Salvage the Array Hash Monster.

Thread Previous | Thread Next
From:
Autrijus Tang
Date:
July 26, 2001 23:18
Subject:
Re: [Help] Salvage the Array Hash Monster.
Message ID:
20010727141844.A34318@not.autrijus.org
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.

<http://www.autrijus.org/ArrayHashMonster-0.03.tar.gz> 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.

Thanks,

/Autrijus/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About