in reply to Trying to write a subroutine to return if file is Text or Binary

You could find this node useful also.
use File::LibMagic ':easy'; my $infile = $ARGV[0]; print $ARGV[0]," =", MagicFile($infile),"\n";
  • Comment on Re: Trying to write a subroutine to return if file is Text or Binary
  • Download Code