in reply to Re^6: parse $ENV{'QUERY_STRING'}
in thread parse $ENV{'QUERY_STRING'}

By itself, the web browser isn't going to execute a script for you, even if it lives on your local filesystem. The browser simply knows how to "ask" for something at a particular address.

In order for you to do something with the data, you're going to need a program that is listening for the request. That's why people are asking you about a web server. There are several ways you can create a simple web server on your machine to serve up your form and then process the results. I've not tried it personally, but I see that CPAN has HTTP::Server::Simple, which may be a good choice. (As I said, I've never used it, I'll defer to the other monks who have experience with web coding.)

Update: OK, I got really bored, so I installed HTTP::Simple::Server to give it a go. It was pretty simple, I just liberally cargo culted together something from the documentation, and it worked as advertised. I put the code in <readmore> tags so no-one has to look at it unless they're bored.

#!env perl { package sillyServer; use HTTP::Server::Simple::CGI; use base qw(HTTP::Server::Simple::CGI); use Data::Dump 'pp'; # URL paths to monitor my %dispatch = ( '/hello' => \&resp_hello, ); # Look up the path and execute the associated routine, or # give a typical 404 error sub handle_request { my ($self, $cgi) = @_; my $path = $cgi->path_info(); my $handler = $dispatch{$path}; if ("CODE" eq ref $handler) { print "HTTP/1.0 200 OK\r\n"; $handler->($cgi); return; } print "HTTP/1.0 404 Not found\r\n", $cgi->header, $cgi->start_html("Nada Darn Thing To C Here"), $cgi->h1("Nuttin here"), $cgi->end_html; } # handler for "/hello" sub resp_hello { my $cgi = shift; return if !ref $cgi; print $cgi->header, $cgi->start_html("Hello"), $cgi->h1("Hi there!\n"), $cgi->p("Parameters from \$cgi: ", pp($cgi->{param})), $cgi->p("Parameters from ENV: $ENV{QUERY_STRING}"), $cgi->end_html; } } # Start up the server use strict; use warnings; my $pid = sillyServer->new(8088)->run; print "PID = $pid, press ^C to stop\n"; my $t = <>;

Just enter "127.0.0.1/hello?Foo=bar" into your browser's address bar, and get a simple page that displays the parameters from the $cgi->{params} variable as well as from the %ENV variable.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^8: parse $ENV{'QUERY_STRING'}
by Anonymous Monk on Jul 03, 2017 at 14:10 UTC
    thanks very much...I greatly appreciate all your work and help!