How to get the query string value in perl cgi script
How to get the query string value in perl cgi script
In this tutorial we will see how to get the query string value using very simple perl CGI script.
When we hit a URL from the web browser with a query string say
http://mistonline.in/cgi/data.cgi?program=php
In which program=php is the query passed.Now we will see how we get the same value using perl CGI script.
Here is the code
-
#!/usr/bin/perl
-
#Script From Mistonline.in
-
use strict;
-
use CGI;
-
my $cgi = new CGI;
-
print
-
$cgi->header() .
-
$cgi->start_html( –title => ‘Cgi Query String Results‘) .
-
$cgi->h1(‘Values Passed’) . “\n“;
-
my @params = $cgi->param();
-
print ‘
‘ . “\n“;
foreach my $parameter (sort @params) {print “
$parameter “ . $cgi->param($parameter) . “ \n“
;}print “\n“
; -
print $cgi->end_html . “\n“;
-
exit (0);
Incoming search terms:
- perl query string (34)
- perl cgi query string (26)
- perl get query string (23)
- perl cgi get query string (17)
- perl querystring (12)
- c# how to make get query string as jquery (2)
- getting the value from URL in perl (1)
- sorting cgi query strings (1)
- read query string value in perl (1)
- cgi get QUERY value (1)
- cgi get query values (1)
- perl print http query string (1)
- perl getquery (1)
- perl get values from query string (1)
- cgi get querystring (1)
- perl encrypt querystring (1)
- get query string parameters with perl (1)
- perl cgi parse query string (1)
- get the current url without a query string cgi perl (1)
- perl cgi ajax query string (1)
- how to print query string in perl (1)
- url query string perl (1)