I struck in a simple nested if statement.
The requirement is as below.
if (Condition1) {
if (Condition2) {
print "All OK";
}
else {
print "Condition1 is true but condition2 not";
}
else {print "Condition1 not true";
}
Is it possible to write this code in Perl or is there another short or better way to fulfil this condition?
The if condition 1 is true. The clause is missing its closing
}which should be inserted right before the last else.Try to line things up this way: