Hello Monks,
Just wondering if this would be the correct way to write a subroutine to see if a file is binary or text. It appears to run however when I changed the file it looks at to all zeros and ones it still showed up with Text file? Any advice?
sub type {
if (-T $FileInfoName) {
return "Text file";
}
elsif (-B $FileInfoName) {
return "Binary file"
}
}