The information currently picked up from the form is:read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @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; if ($INPUT{$name}) { $INPUT{$name} = $INPUT{$name}.",".$value; } else { $INPUT{$name} = $value; } }
I tried to get my checkboxes to function using:if ($INPUT{'onething'} eq "onething") { &onething; } elsif ($INPUT{'onething'} eq "twothing") {&twothing; } elsif ($INPUT{'threething'}) {threething; } else {&formula; } exit;
But alas $address remains undefined.if ($INPUT{'fourthing'} eq "four") { $address = "four.txt"; } elsif ($INPUT{'fourthing'} eq "five") { $address = "five.txt"; } elsif ($INPUT{'fourthing'} eq "six") { $address = "six.txt"; } else {&formula; }
I would be grateful if someone would point me in the right direction. (I could just rewrite it for CGI.pm but I would miss an opportunity of learning some more about environment vars - hence the question. :))
In reply to Extracting name value pairs from Environment Variables by jonnyfolk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |