#!C:\Perl\bin\perl
#-Revision--------------------------------
|
##########################################
# Assign some values to a scalar variables
$var = "String";
$int = 100;
$flt = 1.5;
#########################################
# Assign some more values to scalar variables
$word = "Im enjoying"; $word1 = " working "; $word2 = "with "; $word3 = "PERL!";
##########################################
# Assign some variables to an array
@arr = ("String1", 100, 5.4, "String2", 3.14);
##########################################
# Assign some values to a hash variable
%hash = ("Car", "Ford", "Number", 100, "Game", "Farcry");
##########################################
# Output a here document displaying these variables
print << "DOC";
Content-type:text/html\n\n
<html>
<ul>
<li>This is a string variable: $var
<li>This is an integer variable: $int
<li>This is a floating number: $flt
<hr>
<li>Here is my array: @arr
<li>Heres is my arrays 1st element: $arr[0]
<li>Heres my arrays 2nd element: $arr[1]
<li>Heres my arrays 3rd element: $arr[2]
<li>Heres my arrays 4th element: $arr[3]
<li>Heres my arrays 5th element: $arr[4]
<hr>
<li>My car is a $hash{"Car"}
<li>The number is $hash{"Number"}
<li>My newest game is $hash{"Game"}
<hr>
<li>Here are my word variables: $word3 $word1 $word2 $word
<hr>
I will now concatenate these variables to create a sentance!
</ul>
</html>
DOC
# Concatenate the variables word1 and word2.
$word4 = $word.$word1.$word2.$word3;
print << "DOC2";
Content-type:text/html\n\n
<html>
<p>Here is my concatenated sentance!: $word4</p>
</html>
DOC2