It's very well defined. If you string contains numerals, then the numerals will be converted to numbers. Strings without numerals will be converted to zero. The following code will consider the two strings as equal:
my $str1 = "perl123"; my $str2 = "aaaa123"; if ($str1 == $str2) { print "Strings are equal\n"; }
You can check out perldoc perlop to find more information on this.
In reply to Re^3: is behaviour undefined for string comparision with ==
by spiritway
in thread is behaviour undefined for string comparision with ==
by edwardt_tril
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |