$x = 5;
$y = 10;
# if
if ($x == 5) {
    print "x is indeed 5\n";
}
# if ... else
if ($y == 5) {
   print "y is indeed 5\n"
} else {
   print "y is not 5\n";
}
# if ... else using the ? : operator
$my_result = ($y == 5) ? "y is indeed 5" : "y is not 5";
print "My result is: $my_result\n";

# if ... elsif ... else with multiple statements
if ($x > $y) {
  print "Result is: x ($x) is greater than y ($y)\n";
} elsif ($my_result eq "y is not 5") {
  print "Result is: I know that $my_result\n";
} else {
  print "Result is: x ($x) is not greater than y ($y)\n";
}