P
Pat
Hi,
I'd like to use "Tie::IxHash" to maintain the order of keys in a hash.
Since the hash can contain other hashes (and so on), I need to use
"Tie::IxHash::Easy" so that the nested hashes also maintain their ordering.
I'm reading the entire hash from a file. The format of the file is exactly
like Data:umper so that I can build the hash by simply saying:
eval($file_contents);
This fails because there's no way to "tie" the internal workings of eval to
"Tie::IxHash::Easy" so it always just returns a normal hash. Copying the
returned into an IxHash has no effect because the ordering is already lost.
So, how can I load an IxHash from a file in Data:umper format and
preserve its order (including nested hashes)?
Thanks.
I'd like to use "Tie::IxHash" to maintain the order of keys in a hash.
Since the hash can contain other hashes (and so on), I need to use
"Tie::IxHash::Easy" so that the nested hashes also maintain their ordering.
I'm reading the entire hash from a file. The format of the file is exactly
like Data:umper so that I can build the hash by simply saying:
eval($file_contents);
This fails because there's no way to "tie" the internal workings of eval to
"Tie::IxHash::Easy" so it always just returns a normal hash. Copying the
returned into an IxHash has no effect because the ordering is already lost.
So, how can I load an IxHash from a file in Data:umper format and
preserve its order (including nested hashes)?
Thanks.