Please read the
Site How To about how to mark up posts to make them more readable (especially code). As to the question: determining MIME-type is not a specifically a perl issue, and sometimes it's a no-brainer (image/gif, e.g. is obviously the mime-type for .gif files. And once you learn the template, you can figure out all sorts of them.) But so much for that -- you want a solution! actually, There is a Perl module (
File::MMagic) that can help you. Again, in the spirit of showing you how to fish, I'll point you to
Re: Opinions on determining mime type and its attendant thread.
Philosophy can be made out of anything. Or less -- Jerry A. Fodor