CISW 310—Leever 1
Remember you will have to change the permissions on all the individual scripts to make
them work. Page to be submitted through my website should be called “perlbasics.html”
and should have the following scripts hyper linked to it:
1. Using PICO type the following code to create your first script:
print “Content-type: text/html\n\n”;
print "<title>First Script</title></head>\n<body>\n”;
print “<h1>Hello World</h1>\n”;
print “<p>Write a short sentence about yourself</p>\n”;
Note: read my notes! It's not necessary to write all the print lines separately. You can also
do one LONG print line just as easily.
2. Once you have the script written, you need to change your permissions on this
3. From the command prompt, type (assuming the script is named „firstscript.cgi‟):
chmod 755 firstscript.cgi
4. Now go to your browser and make certain that your script is working. This should
generate a normal web page with your content on it
5. Second Script -- follow the same set of directions. For this second script write all
the appropriate HTML tags just like you did in the first script, but this time I want
you to also print the user‟s IP address to the page. That means you will need to
print an ENVIRONMENTAL VARIABLE. The variable for the IP address is:
The Capitalization, the quotes and brackets are necessary to make it work.
You can either assign that to a simple variable name such as $ip and then print it to the
screen, or you can print it directly.