Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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
( ... )
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.


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

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2014-09-02 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (18 votes), past polls