in reply to Tie a hash of hashes?

I just need to search and replace '()' with '{}' and '=' with '=>'.

Instead of replacing
( ... )
with
{ ... }
replace it with
new_ordered_hash( ... )
and define new_ordered_hash as follows:

sub new_ordered_hash { my %ordered_hash; tie %ordered_hash, 'Tie::IxHash'; %ordered_hash = @_; return \%ordered_hash; }

Untested.

Don't forget to untie the lower level hashes when appropriate.

Note: This falls under "2) parsing the file yourself", from my previous post.

Replies are listed 'Best First'.
Re^2: Tie a hash of hashes?
by Anonymous Monk on Feb 02, 2006 at 22:19 UTC
    Ah, good thought. Initial testing looks promising.

    Thanks for the input!