Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: How to check the request is (GET OR POST) in CGI

by Aldebaran (Chaplain)
on Sep 24, 2018 at 22:52 UTC ( #1222938=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1222938]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2019-06-27 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (111 votes). Check out past polls.

    Notices?