Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Stuck in my final step of code using array of arrays

by Laurent_R (Canon)
on Mar 02, 2014 at 18:49 UTC ( [id://1076726]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Stuck in my final step of code using array of arrays
in thread Stuck in my final step of code using array of arrays

I can guess where the 1073 value is coming from, but can't see where the 548 is coming from (except, possibly, that it is one more that the end of the next element).
  • Comment on Re^3: Stuck in my final step of code using array of arrays

Replies are listed 'Best First'.
Re^4: Stuck in my final step of code using array of arrays
by Anonymous Monk on Mar 02, 2014 at 19:32 UTC
    It is actually the 1st letter after the end of the element in the array of arrays that precedes the "wanted" one (i.e. PF03797 in this case).
    I had:
    0 [ PF12951 421 455 ], 1 [ PF03797 822 1073 ], 2 [ PF12951 515 547 ],

    , so, I need the range between the end of whatever is before PF03797 until the beginning of whatever is after PF03797 (in this case there is nothing, since both PF12951 finish before the position 822 that PF03797 starts).
      Alright, if I understand well, then it means that your data is not in the right order, the order that you want to use is the order given by the second or third field. The easiest might then be to start by sorting your AoA in accordance with the second field of each sub-array.
        Yes but I have a hash with 90+ elements that are "important", it's not only PF03797 like I posted in the example...
        So my question, in essence is:
        given my AoA, if I go through it and I discover my "important" code (like PF03797), then find the element in the AoA that is just before it in the sequence (in this case the closest one ends in position 547) and print the range from this position (548) till end end of PF03797 (which I already know of course).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-19 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found