CPAN has several modules that can guess a files type, like File::MimeInfo and File::MimeInfo::Magic. However most of those modules can't give you much more information that the filetype. Therefor I prefer using File::Extractor, which can collect detailed metadata for lots of filetypes like the resolution for image files, artist, title, etc from audio files and much more. The only downside is that it requires an external c library: libextractor.

Also note that I might be quite a bit biased as I'm the author of File::Extractor.

I installed libextractor(http://gnunet.org/libextractor/download/Extractor-0.5.tar.gz) by following the instruction(i.e. running "python setup.py install", everything looks ok), but I still get the same error information. ? ? any idea? many thanks...