if, else, elsif in Perl

by Geethalakshmi 2010-09-17 14:01:55

if, else, elsif in Perl


Simplist form - if only

if (some expression) {
true statement;
}

Using else

if (some expression) {
true statement;
} else {
false statement;
}

Using elsif

if (some expression) {
true statement;
} elsif (another expression) {
another truestatement;
} else {
false statement;
}

Tagged in:

534
like
0
dislike
0
mail
flag

You must LOGIN to add comments