I don't know if I add much to the conversation by simply referring you to Stack Overflow, but I've found that it's a decent repository of information for this sort of question. This question has been asked and answered before <http://stackoverflow.com/questions/22827465/what-perl-module-turns-a-file-extension-txt-jpeg-into-a-mime-type-text-pla/22832209#22832209>, and the answer suggests MIME::Types, but also suggests some content introspection, for which File::Type and File::MimeInfo::Magic get a mention.
I have never used any of these, so I cannot vouch for them myself. Good luck! David On Tue, Aug 23, 2016 at 12:41 PM, hw <h...@gc-24.de> wrote: > > Hi, > > what´s the best way to find out of what type a file is? > > I´ll probably be having a list of available files and another > list of the types I´ll be interested in, and it needs to be > determined which files in the list of available files need to > be processed further and which ones are to be ignored. This > is to store references to files in a database with some > additional information, like the type of the file that is > being referenced. > > File::MimeInfo looks most promising, but maybe there´s a > better way? > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." -- Brian Kernighan