Variable, Standard and Strict CGI

by Hiroshi on 10-10-2007

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
<a href="$url">$url</a>.</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;

  • Share/Save/Bookmark

Stumble it Digg it Bookmark it Tweet it Share at Facebook

Related Posts

Post a Comment

Comment will appear here after approval, Thanks for patience