in reply to WWW::Mechanize trouble reading a text/plain file on a server

You'll need to look at what goes over the wire to find the difference.

My vague guess would be that you get a chunked response but WWW::Mechanize->content does not collect the whole response while the :content_file callback loops to collect the whole response. This would be a bug in LWP::UserAgent or WWW::Mechanize, so both version numbers would be helpful.

Beware of blindly upgrading to LWP::UserAgent 6+, as it has more requirements on https certificates.