Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tie::DxHash - anyone used this before?

Status
Not open for further replies.

shadedecho

Programmer
Joined
Oct 4, 2002
Messages
336
Location
US
I'm using perl 5.8.8 on a linux (debian 3) system, with the "Tie::DxHash" package (v0.93) installed.

The Tie::DxHash package available from CPAN claims to implement an order-preserving, duplicate-key allowing, hash binding for perl. This is similar to the Tie::IxHash which does the same, but without duplicate-keys allowed.

I have run across a bug in the Tie::DxHash, and submitted the bug to the CPAN bug tracking, but haven't received any word back.

i was wondering if anyone has ever used this, successfully? My problem is that whenever I call a function on the Tie::DxHash enabled hash that updates the iterator pointer (like "keys" or "each"), the hash get into some sort of invalid state, and i cannot reset it.

what it appears to be is that after any kind of iteration, either by those function calls, or by "Dumper" or whatever, some sort of "end-of-hash" pointer is no longer updated or initialized correctly.

I can continue to assign values to the hash, and those values DO get stored in the hash, but when i iterate over the hash again, or feed it to Dumper, it doesn't show the new items. But, i can individually access one of the new items, and it's value is there.

However, I *do* get a warning: "Use of uninitialized value in string eq at /usr/local/lib/perl5/site_perl/5.8.8/Tie/DxHash.pm line 69." when I do that. So, it's my guess that something about the iteration functions of this package sets the hash into an invalid state so that further hash append/add operations do not correctly update all internal data and pointers appropriately.

anyone confirm this or have fixed/worked around this before?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top