Perl Statements
This brief section covers the main Perl statements and structures that you will use in a typical CGI page. Most of the statements work the same as they do in JavaScript, but the variables must be prefaced with the correct symbols, and some of the formats might be slightly different.
Output
As you have seen in examples in this chapter, the print statement seems to be the most common output statement. It is. Three key types of print statements will help you get started in Perl with CGI:
Print literal: print "Hamster \n\n";
Print variable: print $bigshot;
Print HTML: print "<strong> Tough </strong>";
A print statement that outputs HTML tags such as <b> is really a formatting technique in CGI, just as using the backslash with n ( ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access