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.
| [reply] [d/l] [select] |