Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Printing Hash of Arrays

by RichardK (Vicar)
on Nov 29, 2012 at 16:50 UTC ( #1006299=note: print w/ replies, xml ) Need Help??


in reply to Printing Hash of Arrays

BTW this bit of code doesn't do what you think it does

push @{ $hash_of_chroms{$chr} }, $coord unless defined $hash_of_chroms{$chr}[$coord]; # don't add +duplicates

push adds the item to the end of the list and you check some list element off in the far distance.

i.e. if the array is empty and $coord = 50, then your code does this:-

$array[0] = $coord unless $array[50];


Comment on Re: Printing Hash of Arrays
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2015-07-29 23:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls