#!/usr/bin/perl
# w2.3.pl -- Perl numeric operators

#comparison

$x = 5;
$y = 4;
$z = 4;

if ($x == $y) {print("1) 5==4\n");} else {print("1) 4==4\n");}
if ($z == $y) {print("2) 4==4\n");} else {print("2) 5==4\n");}

if ($z != $y) {print("3) 4!=4\n");} else {print("3) 4==4\n");}
if ($z != $y) {print("4) 4!=4\n");} else {print("4) 4==4\n");}

if ($x < $y) {print("5) 5<4\n");} else {print("5) 5>4\n");}
if ($x > $y) {print("6) 5>4\n");} else {print("6) 5<4\n");}

if ($x <+ $y) {print("7) 5<=4\n");} else {print("7) 5>=4\n");}
if ($x >= $y) {print("8) 5>=4\n");} else {print("8) 5<=4\n");}

print("\n");

#Unary increment operator:

print("\$x is $x\n");

$x++;		print("After \$x++;  \$x is $x\n");

$a = ++$x; 	print("After \$a = ++\$x;  \$a is $a while \$x is $x\n");

$a = $x++; 	print("After \$a = \$x++;  \$a is $a while \$x is $x\n");

__END__

