in reply to determining Binary file

It is just a guess, but most likely a guess that's good enough.

It is a guess, because Perl only looks at a portion of the file, unless you intentionally disguise it, otherwise, a binary file will quickly reveal itself by showing all kind of stange characters.

However there is this chance that there happened to be no stange character in the chunk Perl verified, but there are some elsewhere. In which case, Perl will report binary as ascii mistakenly.