Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Nested foreach loops

by Anonymous Monk
on Sep 07, 2016 at 22:24 UTC ( [id://1171347]=note: print w/replies, xml ) Need Help??


in reply to Nested foreach loops

Here's where am stuck, how do I loop the first item on NameA column to iterate over all NameBs and return the smallest distance, together with both corresponding NameA and NameB entries then move to the next row and repeat above, and so on till end of file.

What does that mean?

?"Loop first item"? What distance?

If you could please use the numbers from the three lines of data you posted, and in pencil-and-paper fashion , solve the problem step by step for those three lines, this would help me understand what you're asking

Its hard to interpret a program that doesn't work to understand the question being asked

Probably need to read the file into a hash of arrays first, then query it like a database, do some calculations ...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-03-29 07:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found