Perl comparison operator output -
i not sure output of comparison is. instance, consider
$rr = 1>2; $qq = 2>1; print $rr; #nothing printed print $qq; #1 printed
is $rr
empty string? behavior documented somewhere? or how can 1 tell sure?
i looking answer in learning perl schwartz et al., not resolve answer.
http://perldoc.perl.org/perlop.html#relational-operators:
perl operators return true or false return values can safely used numbers. example, relational operators in section , equality operators in next 1 return 1 true , special version of defined empty string, "" , counts 0 exempt warnings improper numeric conversions, "0 true" is.
so returned empty string in string context, , 0 in numeric context.
Comments
Post a Comment