Or check that it matches application/octet-stream MIME type like so:if(-T $file) { print "$file is an ascii text file \n"; } else { print "Not an ascii text file \n"; }
my $ft = File::Type->new(); my $type = $ft->mime_type($file); if ( $type eq "application/octet-stream" ) { do this.. } else { do that.. }
In reply to Perl -T vs Mime::Types by roperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |