Using the CGI module to print the html header and get query strings

#!/usr/bin/perl

use strict;
use CGI;

my $cgi = CGI->new();

print $cgi->header();

If you pass a query string such as ?var1=val1&var2=val2&var3=val3 you can access them with the $cgi->param('variable') as so,

#!/usr/bin/perl

use strict;
use CGI;

my $cgi = CGI->new();

print $cgi->header();
print $cgi->param('val1');

Page Comments (Click to edit)

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Powered by pmwiki-2.2.0-beta65