Unless Statement

Domain Hosting image
Web Hosting
Dedicated server
ssl certificate
Web Design image
Email

You could express the statement: unless the user is root, don't run this program, with the following Perl code:

unless($user eq "root")
{
print("you must be \"root" to run this program\n");
exit; }

In this case, unless the string $user is "root", the program exits.

The unless statement has the same form as if, including the use of elsif and else clauses. The difference is that unless executes its statement block only if the condition is false.

A loop is used to repeat the execution of a statement block until a certain condition is reached. A loop can be used to iterate through an array looking for a value. Loops also can be used to count quantities. Actually, the number of uses for loops is pretty much unlimited. There are different types of loops: while loops, until loops, and for loops.



Domain Name Search

www.


Copyright (C) 2007. Web Domain design hosting. All rights reserved.