http://qs321.pair.com?node_id=472556


in reply to Re: Detecting 'binary' in a variable
in thread Detecting 'binary' in a variable

Not always

$ perl -le '{local$/; $_=<>;}print /^[\x00-\xA5]/ ? "binary" : "text" +' \ /mnt/win/WINDOWS/system32/command.com text