in reply to How to cut down the running time of my program?

A database is probably the best route to take, but if that's not an option then you need to index file1 yourself. You might want to look into B-Trees. Mastering Algorthims with Perl covers them briefly on pages 169-171. This assumes that file1 is sorted by the suject ID (i.e. in ascending or descending order).

Elda Taluta; Sarks Sark; Ark Arks

  • Comment on Re: How to cut down the running time of my program?