Perl “if” Testing

if ($user eq "fred") 
{
print "Welcome in, Fred.\n";
}
elsif ($user eq "joe" || $user eq "jill")
{
print "Get out, $user\!\n";
}
else
{
print "No Admittance.\n";
}

unless ($age > 21 && $smile == "big") 
{
print "You're too young for me.\n";
}
else
{
print "How about a date?\n";
}

Note the “and” ( && ) and “or” ( || ) operators.

Resources

http://www.tizag.com/perlT/perlif.php