in reply to Re: Binary conditionals
in thread Binary conditionals

C. So, $buffer == hex ('0x00') would match if, and only if, $buffer == 0, hence, if $buffer contains the character "0".

Sorry, I have to disagree:

$ perl -wle '"a" == 0 && print "yes"' Argument "a" isn't numeric in numeric eq (==) at -e line 1. yes

So you see that 'a' == 0, and when you have warnings enabled, you also get a warning.

Replies are listed 'Best First'.
Re^3: Binary conditionals
by psini (Deacon) on Sep 30, 2008 at 14:51 UTC

    Right. And this is why the OP complains that too many characters match (but not every character). $buffer==0x0 is true for every char except '1' to '9'.

    Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."