use File::LibMagic ':easy'; my $infile = $ARGV[0]; print $ARGV[0]," =", MagicFile($infile),"\n";