I come from C ++ and I'm trying to learn perl with Perl. However, this code in chapter two 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?
The following explains that the value 2 == 4 is undefined, but this seems confusing and contradictory to me. Two, obviously, are not equal to four, and the same comparison between 4 and 4 will give the truth, leading to "1" at the end of the output. Why doesn't the expression return false?
source share