in reply to gzseek for perl filehandles
I don't know what you are trying to do, but I would suggest that you switch into a real database instead of files and just use SQL queries to get what you want out of if.
It would be faster & compressed?