Quotes around a filename containing spaces would be required with a UNIX shell variable (except inside
[[...]]), but not a perl variable.
As others, I have been unable to reproduce this and suspect it is a coincidence. ^M is usually \r which has come from a Windows file. So I tried a 450k Windows file on Linux, i.e. with ^M characters, and it reported the file as text. I suspect that ^M (\r) is considered to be text.
I don't find -T and -B particularly reliable anyway. From
perlfunc:
If too many strange characters (>30%) are found, it's a -B file; otherwise it's a -T file.You might be better off search for a magic number instead (see the UNIX file(1) command).