unless statement with else : unless « Statement « Perl
- Perl
- Statement
- unless
unless statement with else
$variable = 6;
unless ($variable == 5) {
print "No, it's not five.\n";
} else {
print "Yes, it's five.\n";
}
Related examples in the same category