in reply to Tie::IxHash weird metadata?
$comment is assigned an object reference; it is a thingy that has been blessed as a 'Tie::IxHash'. This is why the dump of $comment looks likemy $comment = Tie::IxHash->new(${$comments}{$key});
comment: $VAR1 = bless( [ ... blah blah blah ... ], 'Tie::IxHash' );
The rest of the 'strangeness' in the second dump consists of other internal data structures in a Tie::IxHash instance.
The real issuse here is using the object correctly. Basically, you want to use the standard TIEHASH interface ot tie the value of your hash to a Tie::IxHash instance. I.e.:
tie (%comments, Tie::IxHash); warn ("comment " . Dumper($comments{$key}));
see the perlfunc:tie and perltie documentation for a more in-depth explaination of tied variables
|
|---|