in reply to Discvering the MIME type of a document from its content
How about File::Type?
The docs says this:
File::MMagic and File::MimeInfo perform the same job, but have a number of problems that led to the creation of this module.
File::MMagic inlines a copy of the magic database, and uses a DATA filehandle, which causes problems when running under mod_perl.
File::MimeInfo uses an external magic file, and relies on file extensions rather than magic to determine the mime type.
As a result, File::Type uses a seperate module and script to create the code at the core of this module, which means that there is no need to include a magic database at all, and that it is safe to run under mod_perl.
File::Type::Builder, which generates the code at the heart of this module.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|