I am learning scripting in perl. I have encountered an example which I don't understand:
my $num = 50;
if ($num) {
print "True: $num\n";
} else {
print "False: $num\n";
}
This is very simple indeed and it prints out the number 50 but what I don't understand is the condition. I expect something like if ($num) > 40
or any thing that tells computer to examine a condition. How does computer interpret if ($num)
as a condition?
Thanks for any explanation.