tags:

views:

250

answers:

3

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

The same that the linux "file" command does, but in Perl language.

Thanks.

+6  A: 

Have a look at the File::Magic module on the CPAN.

converter42
I also found File::MMagic that does a similar work.
David Ameller
+2  A: 

Take a look at File::Magic

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

Andy Lester
A: 

I finally opted to do something like

$res = `file a.txt`;
David Ameller