Hi,

I would like to know of a good way of storing form values (POST and GET) in
a form hash, such as %in

Here is what i am currently using:

sub ReadParse {
 local (*in) = @_ if @_;  local ($i, $loc, $key, $val);
 if ($ENV{'REQUEST_METHOD'} eq "GET") { $in = $ENV{'QUERY_STRING'};}
 elsif ($ENV{'REQUEST_METHOD'} eq "POST")
      {read(STDIN,$in,$ENV{'CONTENT_LENGTH'});}
 my @in = split(/&/,$in);
 foreach my $i (0 .. $#in) {
  $in[$i] =~ s/\+/ /g;    ($key, $val) = split(/=/,$in[$i],2);
  $key =~ s/%(..)/pack("c",hex($1))/ge;
  $val =~ s/%(..)/pack("c",hex($1))/ge;
  $in{$key} .= "\0" if (defined($in{$key}));
  $in{$key} .= $val;
  }
 return 1;
 }

I dont think it is very good to use CGI module beucase this is basically all
of it that i would use....

Thanks for any help...




Roy Nasser ([EMAIL PROTECTED])
Diretor T�cnico
http://Vem.ca/
+55-11-3347-3011
+55-11-9953-8853 (Cel.)
+55-11-211-0889 (Fax.)



Reply via email to