in reply to TIEd object (TIEd hash inside a TIEd hash)

There are many issues with the code you posted, there are methods which are missing, these methods are peculiar to tying hashes, in addition you have added a method "new" instead of "TIEHASH" as your class constructor...TIEHAHS would let you return a blessed reference through which the new object would be accessed but in a capacity related to hashes.

Tying hashes is different from tying scalars or arrays since each have their own particular methods, and these are the methods that you need to define when it comes to tying a hash:

The documentation provides a straightforward approach, this topic is addressed in Programming Perl as well...


Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.

Replies are listed 'Best First'.
Re^2: TIEd object (TIEd hash inside a TIEd hash)
by jeanluca (Deacon) on Jan 24, 2010 at 08:31 UTC
    Doesn't Tie::StdHash take care of all the missing methods ?
    Furthermore, I have a new method because in the main program I want to create an object with new, not with tie

    UPDATE: I don't think there are problems with my TIEd hashes. I get problems when I put the second one into the first