Generating HTTP Headers and HTML Tags via CGI.pm
One use of CGI.pm is to generate HTTP headers and HTML tags so that you don’t have to write them out in print statements yourself. The ability to generate HTML using CGI.pm is particularly useful for people who are Perl programmers and aren’t proficient with HTML. I would recommend learning HTML to anyone who’s serious about CGI programming, but if you’re a Perl programmer, you can use CGI.pm to generate lots of HTML for you. One serious flaw with this approach is that anyone wanting to change the layout of pages you generate using CGI.pm in this way will have to know Perl, which can be a problem if you are working on a team that includes designers who are familiar with HTML and not Perl.
Get Sams Teach Yourself CGI in 24 Hours, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.