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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -