Perl command or module like Linux “file” command
I have a script that downloads files but these files do not have any information about them before they are downloaded. While writing for Linux I have just called qx{ 'file ' . $filename } to see if it is a JPEG image an if not delete it. However, I am now trying to rewrite to a platform independent and pure-Perl form. I have turned all the calls to system{ 'curl', $image_website } to LWP::UserAgent calls and I was hoping that there is some way to replace calls to file with something as well. File::Type CPAN module can help you - its description is "determine file type using magic" which is