In perl, you should compare two lines with "eq" or "ne", etc.
I'm a little surprised that the following code snippet will print "yes."
$str = "aJohn"; $x = substr($str, 1); if ($x == "John") { print "yes\n"; }
My perl version is v5.18.4 on Ubuntu.
Is there a case where "==" on two lines produces a different result from "eq"? Thanks.
source share