I'm pulling my hair out on this one. I just need a way to find out if a file is text or binary. Is there something out there?
I found a workaround (since no one else could answer...)
$a = perl -e 'if (-T "$file"){ print 1; }'; if ($a == 1){ $filetype = " - Text"; }
perl -e 'if (-T "$file"){ print 1; }'