Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Tie a hash of hashes?

by ikegami (Pope)
on Feb 02, 2006 at 20:47 UTC ( #527430=note: print w/ replies, xml ) Need Help??

in reply to Tie a hash of hashes?

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

Instead of replacing
( ... )
{ ... }
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; }


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

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

Comment on Re: Tie a hash of hashes?
Select or Download Code
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!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://527430]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2015-11-30 00:53 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (755 votes), past polls