Yes, I think I get it. Sort your array (see my other post on how to do it: Re: Stuck in my final step of code using array of arrays). Then go through the array sequentially; for each element in the array, look into your hash if the element is of specific interest, and if it is, look at the end of the previous range (you might store it in a temporary variable as you scan the array so that you don't need to go back to the previous record), get the end of the current range and print out what you need. Is this clear enough? Building on my @d sorted array given in the afore-mentioned other post, this can be something like that (still demonstrated under the Perl debugger):
DB<6> $hash{'PF03797'} =1; DB<7> foreach $aref (@d) { print "$aref->[0]: ", $previous+1, " $are +f->[2] \n" if exists $hash{$aref->[0]}; $previous = $aref->[2];}
Which prints:
PF03797: 548 1073
because I created the hash for value PF03797.

In reply to Re^7: Stuck in my final step of code using array of arrays by Laurent_R
in thread Stuck in my final step of code using array of arrays by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.