#!/usr/bin/perl -w


#
# Create a new variable, and assign it a value
#
$a = 1;


#
# Change the type of a variable on the fly
#
$a = "one";

#
# Your basic if statement
#
if ($a eq "one") 
{
	$a = 3;
}
elsif ($a == 3)  
{
	$a = "three";
}

#
# Print a variable
#
print "A is equal to $a\n";

#
# Do some math
#
$a = 1 + 2 / 3 * 4 + 5 / 6;

#
# Basic for loop
#
for($a = 0; $a < 10; $a++) {
	$sum = $sum + $a;
} 
print "The Sum is $sum\n";

#
# Basic while loop
#
$a = $sum = 0;
while ($a < 10) 
{
	$sum = $sum + $a;
	$a++;
}


