in reply to if statement question
## scalar has not been initialized here the value in $result is undef
print "hi" if ($result);
### scalar has been initialized and the value here is 12
$result = 12;
print $result if($result);
In 1st ,if condition looks for the value of a variable "$result" in this case its just declared its not been initialized hence if is evaluated as false and doesn't print "Hi"
In second, if condition looks for the value of a variable, its present & value is 12 , then if is evaluated as true and it print's "hi".