in reply to Search Efficiency

If you can make the id be the first column and sort on id, then Search::Dict is your friend.

A database would be an even better friend.

But if this is something like a log file, you will likely find that File::Tail does the trick for you.

BTW a warning. Unless your operating system and Perl both support filesizes over 2 GB, your file may wind up losing data. The solution to that is to break it into pieces and rotate it periodically.