Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I obtain file meta information in Perl?

Tags:

file

perl

I'm looking for a module or some way to obtain the information about the content of a file.

The same sort of thing that the Linux "file" command does, but in Perl language.

like image 464
David Ameller Avatar asked Nov 17 '08 15:11

David Ameller


2 Answers

Have a look at the File::Magic module on the CPAN. (Editor's note: This module was removed by its author.)

like image 79
converter42 Avatar answered Oct 20 '22 17:10

converter42


Take a look at File::Magic

http://search.cpan.org/~rehsack/File-Magic-0.01/

File::Magic is no longer supported. Use File::MMagic instead (also metacpan.org is now preferred over search.cpan.org)

https://metacpan.org/pod/File::MMagic

like image 22
Andy Lester Avatar answered Oct 20 '22 18:10

Andy Lester