| Module Info
| Add a review of MIME-Type-FileName
The module is very simple and minimal. It consists of a small piece of code which is run when the module is used, which maps a hash of file endings to mime types, a routine called "guess" which strips the file extension and returns the equivalent mime type, or "application/octet-stream" if no extension is found, and a big block of data of extension to file name.
Unfortunately it overwrites its own values, so .jpeg turns into image/pjpeg, as reported here:
so that kind of issue shouldn't have arised.
I wonder why the author created this module. I remember using MIME::Types back in 2008 or so, and the first version of this one dates from 2012. Good old MIME::Types gets 13/16 file names to correct mime types in my test, but this only gets 8/16. What was the original motivation for making another file extension to mime type module? It's not documented.
Anyway it is nice and simple, and self-contained, but unfortunately not very accurate.
For a comparison with similar modules, please see my page at www.lemoda.net/perl/find-type-of-file/