positions are integers; there are millions of single positions; there are millions of lines; the length of the lines is typically in the 1000s
I have tried this in a database with judicious use of joins. I'm happy to stick with the database but i thought due to the large numbers involved there might be a quicker solution in perl.