Tip:
Highlight text to annotate it
X
Hello everyone and welcome to Chapter 7! My name is Dr. Theodor Richardson and I will
be guiding you through some vital steps in creating a multimedia Web site. In this
video, you will learn how to create a page in Perl for your Web site.
Perl is a server-side language. This means it executes on the server prior to the viewer
seeing the page. This effectively hides the source code from the viewer. Perl
must be installed on the server for it to be used. Once it is installed on the server, it can
be used to create a page. The page must be saved with a .pl extension for the server to
recognize the code and process it.
Perl code cannot be added within an HTML page; it must be used to create an entire file. The
first line of a Perl file should be the path to the Perl binary file on the server. The example
shown represents only the most common path. You will need to verify this on your server to
make sure your code will work.
The command to output text to the browser is print. The text that is to be printed should be
treated as a string. All lines of Perl code need to end with a semicolon.
Variables in Perl can be declared with a dollar sign ($) regardless of the content they
will contain. In the example shown, the variable contains the message that was printed by
the print command in the previous example. The variable can be called by using its
name. The result of this example is the same as the previous example that used only
the print command.
Unlike PHP, Perl must print all of the HTML content of the page. This includes all of the HTML
page setup information and any content you wish to include. You should test your Perl pages
routinely to make sure all of your tags are present and closed properly. Enjoy!
If you like this video and want to learn more, you can buy my book Multimedia Web Design and
Development available from Mercury Learning and Information. Also available at
Amazon.com.