Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: lighter alternative to CGI.pm

by Vennis (Pilgrim)
on Aug 30, 2002 at 09:09 UTC ( [id://194032]=note: print w/replies, xml ) Need Help??


in reply to lighter alternative to CGI.pm

I personnally wouldn't use the next code and strongly advice to create a better running server...

But, FYI, you can parse the parameters manually. Depending on the complexity, you could use this.

If you use this 'wannahave a Big Ball of Mud solution' (i love that name) make sure you check the parameters for security problems.

my $input; if ($ENV{REQUEST_METHOD} eq 'GET'){ $input = $ENV{QUERY_STRING}; } else { read(STDIN,$input,$ENV{CONTENT_LENGTH}); } foreach( split(/&/,$input)){ $_ =~ tr/+/ /; my ($name,$value) = split(/=/,$_,2); $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; if($param{$name}) { $param{$name}.= ",$value"; } else { $param{$name} = $value; } print "Found $name = $value\n"; }

Replies are listed 'Best First'.
Re: Re: lighter alternative to CGI.pm
by perrin (Chancellor) on Aug 30, 2002 at 12:54 UTC
    There's really no need to resort to that. Using a properly coded module does not add significant overhead. Replacing CGI with CGI_Lite turned out to improve overall performance of the script by 60%.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-23 11:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found