| Module Info
| Add a review of File-MimeInfo
If you want to go from file extension to mime type, this module does the job well, and additionally if it cannot work out what the mime type is from the file extension, it tries to read a bit of the file and work out from that whether it's binary or text.
A rival for this module is Media::Type::Simple, but that module is inconvenient in that you have to strip out the file extension yourself, and for some reason Media::Type::Simple throws a fatal error when given a file extension it doesn't recognise.
Although the results of the two modules are mostly identical, File::MimeInfo seems to give marginally better mime types for some kinds of data.
Anyway, this module seems useable to me.
For a full comparison including source code and results on various files, see www.lemoda.net/perl/find-type-of-file/