How To Declare DOCTYPE And Encoding Using CGI.pm And PERL

Author: , May 31st, 2011

I found myself needing a specific doctype the other day and this is what I found… First, get the correct doctype string from the W3C website list. Then, simply use -dtd to specify it to CGI.pm during the call to start_html:

In addition, use -encoding to specify the character set for XHTML. It defaults […]

How To Delete A Cookie Using Perl CGI.pm Or jQuery

Author: , May 3rd, 2011

Using CGI.pm

Using jQuery and jquery.cookie.js

How To Use Special Characters in the Browser Title With CGI.pm

Author: , October 9th, 2010

Set AutoEscape to OFF: [code]$cgi->autoEscape(0);[/code]

Redirecting Using CGI.pm

Author: , October 7th, 2010

To generate a redirection header in CGI.pm use the following syntax where $q is the cgi handle: print $q->redirect(‘http://wyzaerd.com/documents/resume.pdf’); If you use redirection like this, you should not print out a header as well. You should always use full URLs (including the http: or ftp: part) in redirection requests. Relative URLs will NOT work correctly.