Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Problems with complex structure and array of arrays

by tangent (Curate)
on Mar 01, 2012 at 22:45 UTC ( #957343=note: print w/ replies, xml ) Need Help??


in reply to Problems with complex structure and array of arrays

The array @global_els contains all elements, not just the elements associated with each $row_el. Although there are other ways to better achieve what you want, you could fix your code by adding one line:

foreach $row_el (@row_els) { print "\t",$row_el; foreach $global_el (@global_els) { # add this line... next unless exists $score_of{$row_el}{$global_el}; print "\t",$global_el; print ",",$score_of{$row_el}{$global_el}; } print "\n"; }
BTW if you used warnings you would have got a host of "unitialised value" errors. Data::Dumper is a great help too in these situations.


Comment on Re: Problems with complex structure and array of arrays
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (13)
As of 2015-07-01 18: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 (16 votes), past polls