This lesson will cover the basic perl data type and how to print to the console. This basic unit is called a Scalar variable and it can hold integers(1, 2, 3, 4, ...), floats (3.1549...), characters(a, b, c, etc...) and strings("bob is a good dog."). Scalars are a very versitile datatype that will be commonly used.
Also of note is that perl like many other common languages uses a semi-colon ( ; ) to signal the end of the line. Missing semi-colons is the cause of untold bugs so if something at first does not work check to see if you forgot that little guy.
Code:
#!/usr/bin/perl
$myFirstVariable;
# this is a empty variable it contains no data.
$myFirstVariable = "Hello World!";
# I have assigned the string "Hello World!" to the variable.
# You can also assign a value when you declare the variable like this $foo = "bar";
print $myFirstVariable . "\n";
# This outputs the string that is inside the $myFirstVariable out to the screen.
# After the variable is a period this is the concatenation operator and it glues
# the piece on the left with the part on the right, in this case "Hello World!" and "\n".
# Lastly "\n" is the newline escape sequence.