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)






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.