Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

RE: Avoiding GET in CGIs

by le (Friar)
on Jul 13, 2000 at 17:54 UTC ( [id://22378]=note: print w/replies, xml ) Need Help??


in reply to Avoiding GET in CGIs

Whenever you try to do some CGI task in Perl, you are urged to use CGI.pm (it's part of the standard distribution of newer Perls). So to avoid GETs:
use CGI; my $q = CGI->new; if ($q->request_method() eq "GET") { # do something print $q->redirect("http://somewhere.org/"); exit; }

Replies are listed 'Best First'.
RE: RE: Avoiding GET in CGIs
by Michalis (Pilgrim) on Jul 14, 2000 at 10:13 UTC
    I am using CGI.pm (actually a heavily modified version of it) but I was unaware of that function.
    Thanks for pointing that out. It looks (and probably is) better.
    It also works with parameters in the Location Bar (and not only if the form is submitted through a GET).
    The only problem I see with that is (is it really?) performance issue as you have to create the new CGI object before the check.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2025-02-17 00:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found