Search notes:

Perl module File::LibMagic

#!/usr/bin/perl
use warnings;
use strict;

use File::LibMagic;

use File::Spec;
use Cwd;

my $lm = File::LibMagic->new;

print $lm -> describe_filename ($0         ), "\n"; # a /usr/bin/perl script, ASCII text executable
print $lm -> describe_filename ('README.md'), "\n"; # ASCII text
Github repository PerlModules, path: /File/LibMagic/script.pl

Installing lib magic

The module needs lib magic.
It can be installed with apt-get
sudo apt-get install libmagic-dev
or yum
yum -y install file-devel

See also

Perl module File::Type
Perl modules.

Index