my $str = "Hello";
print "str: $str \n";
if ($str > 0) {
print "str > 0 \n";
} elsif ($str < 0) {
print "str < 0 \n";
} else {
print "str == 0 \n";
}
print "\n";
$str = "1Hello";
print "str: $str \n";
if ($str > 0) {
print "str > 0 \n";
} elsif ($str < 0) {
print "str < 0 \n";
} else {
print "str == 0 \n";
}
print "\n";
if ("World" > 0) {
print "World > 0 \n";
} elsif ("World" < 0) {
print "World < 0 \n";
} else {
print "World == 0 \n";
}
print "\n";
if ("World" gt 0) {
print "World gt 0 \n";
} elsif ("World" lt 0) {
print "World lt 0 \n";
} else {
print "World == 0 \n";
}
The output of the above code is:
str: Hello
str == 0
str: 1Hello
str > 0
World == 0
World gt 0
No comments:
Post a Comment