I come from C++ background and am trying to learn perl with Beginning Perl. However, this code in the second chapter has left me confused:
#!/usr/bin/perl
use warnings;
print"Is two equal to four? ", 2 == 4, "\n";
When I run the code, this is output:
Is two equal to four?
It is explained further below, that the value of 2==4 is undefined, but this seems confusing and counter-intuitive to me. Two obviously isn't equal to four and the same comparison between 4 and 4 would yield true, leading to a '1' at the end of the output. Why doesn't the expression return false?