in reply to Reg: Performance

Use the command line sort to sort both files. Then you can "walk" through both of them in one pass without having to read file B, 5 million times! B appears to be small enough to fit into memory, you could just make a hash, but I take it that the "unique id" id's really aren't unique and you can have multiple values for each id, if so then just make a HoA.

Replies are listed 'Best First'.
Re^2: Reg: Performance
by sivaraman (Initiate) on Oct 28, 2010 at 05:55 UTC
    Thank you Marshall for your quick reply. Can you please tell me the command to sort both the files as I am new to PERL. - Thank you.

      It's not a Perl command, it's a system command: sort. It's common on *nix and available for Windows.