Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: lighter alternative to CGI.pm

by Vennis (Pilgrim)
on Aug 30, 2002 at 09:09 UTC ( #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
Node Status?
node history
Node Type: note [id://194032]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2021-04-12 03:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?