Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: array of hashes use

by bioinformatics (Friar)
on Apr 02, 2013 at 01:05 UTC ( [id://1026557]=note: print w/replies, xml ) Need Help??


in reply to array of hashes use

For the inner loop you can use an anonymous hash like:
while ($line = <FH>) { chomp $line; next if $line =~ /^$/; next if $line =~ /[#{}]/; $line =~ /^\s*(\S+)\s*(\S+)/; # new portion $host[$counter]{$1} = {$2}; }
You could push or simply use a counter (which keeps the code cleaner). Just one idea anyway :).

Bioinformatics

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found