Questions about this topic? Sign up to ask in the talk tab.

Difference between revisions of "Perl/Basics/Boolean Logic/Statements/Unless"

From NetSec
Jump to: navigation, search
 
(No difference)

Latest revision as of 02:14, 19 July 2012

An unless statement may only have the unless clause and an else clause.

unless ($age >= 21) {
    print "All content is restricted for users under the age of 21.\n";
} else {
    print "Welcome to our sample age gate!\n";
    display_content();
}