in reply to Re: How to check the request is (GET OR POST) in CGI
in thread How to check the request is (GET OR POST) in CGI

This was an interesting thing for me to replicate, working through basic cgi scripts for the first time. What I didn't know as well is that GET uses what comes after the '?' in urls.

-------executing upload 1.env.cgi -------cat uploaded file #!/usr/bin/perl -wT use strict; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); print header; print start_html("Environment"); foreach my $key (sort(keys(%ENV))) { print "$key = $ENV{$key}<br>\n"; } print end_html; __END__

link to a cgi script showing envelope with a value after the ?.

Replies are listed 'Best First'.
Re^3: How to check the request is (GET OR POST) in CGI
by davido (Cardinal) on Sep 25, 2018 at 01:30 UTC

    Nowadays you almost never need to care about CGI for new work. CGI is cool to learn to understand the basics, and I do encourage you to dig into those nuts and bolts behind the scenes. But modern frameworks like Mojolicious are much nicer to work with for new projects.

    Using CGI (or rolling your own CGI toolkit) for new work in 2018 is not the shortest path toward getting a good product completed. But learning CGI will help to gain a deeper understanding of how internet protocols work now, and have evolved over time.


    Dave