in reply to Read a line with max length ?

Since I needed something like this, I decided to create something reasonably efficient and wrap it up as a CPAN module.

http://search.cpan.org/~robm/File-GetLineMaxLength/

Someone wrote a review as well here File::GetLineMaxLength, the infinite loop bug + README file issues have been fixed since 1.01.