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

Replies are listed 'Best First'.
Re^3: Detecting 'binary' in a variable
by Transient (Hermit) on Jul 05, 2005 at 18:23 UTC
    That's correct, but that's not the same regexp:

    /^[\x00-\xA5]/
    ne
    /[^\x00-\xA5]/

      Sorry. My fault.

      But then, again, any text with accented vowels (à,è etc., in Italian, French, Spanish) will look like binary.

        \xA5 = 165 which should match just about everything except Greek (as per the OP's specs). Unicode not considered either.