Variable, Standard and Strict CGI
by Hiroshi on October 10th, 2007
Lets discuss deeply variables in CGI, standards of CGI and strict syntax of CGI scripts.
Variable and Standard
#!/usr/bin/perl -wt use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use strict; my $email = "someone\@server.com"; my $url = "http://www.someurl.com"; print header; print start_html("Scalars"); print <<EndHTML; <h2>Hello</h2><p>My e-mail address is $email, and my web url is $url.</p> EndHTML print end_html;
While here is how we define strict syntax for CGI script.
#!/usr/bin/perl -w # test.cgi by Bill Weinman [http://bw.org/] # Copyright 1995-2003 William E. Weinman # Free Softare: Use and distribution under the same terms as perl. use strict; use CGI;