Else

Updated: 04/26/2017 by Computer Hope
Bunch of words associated with programming.

Else is a programming conditional statement that if previous conditions are not true displays alternate information or performs alternate commands.

my $x = 10;
if ($x == 10) { 
print "X equals 10"; } else { print "X does not equal 10";
}

Above is an example of Perl code that first sets the x variable as 10. If this value remains 10, then the first if statement prints "X equals 10". However, if this value changes it would print "X does not equal 10".

Conditional statement, Else if, If statement, Programming terms