in reply to Re: Calling a sub-routine in CGI
in thread Calling a sub-routine in CGI

I'm sorry, but I'm still learning...Where can I learn more about UNWEB? Thanks

Replies are listed 'Best First'.
Re: Re: Re: Calling a sub-routine in CGI
by Massyn (Hermit) on Aug 09, 2002 at 12:36 UTC
    Here's what you need...
    sub unweb { if($ENV{QUERY_STRING} eq "") { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else { $buffer = $ENV{QUERY_STRING}; } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/~!/ ~!/g; $FORM{$name} = $value; } return %FORM; }
    Have a look at cgi101. That's where I started with CGIs.