Free Guides
Language Tutorials

Perl
Get Down and Boogie!
::Return to index:: << Previous Chapter Next Chapter >>
If you've ever used any other programming language, then you're probably familiar with if/else statements. If not, here's a brief explanation. If/else statements test to see if something is true or not:"If" it is, then the script will do one thing. Otherwise, it'll do something "else." Pretty keen, huh?
Here's how an if/else statement is written:
if (statement) {
task
} elsif (statement) {
a different task
} else {
a task if all else fails
}
Once you understand the basic concept of if/else, you're ready to explore the wonderful world of variables.