CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
form data types



Jun 27, 2000, 4:41 AM

Post #1 of 1 (560 views)
form data types Can't Post

I have an HTML form that gathers info and a perl script that parses the form and manipulates the data.

Here is the parse function:
sub parse_form_data {
local (*input) = @_;
local ($request_method, $post_info, @key_value_pairs,
$key_value, $key, $value);
read (STDIN, $post_info, $ENV{'CONTENT_LENGTH'});
@key_value_pairs = split (/&/, $post_info);
foreach $key_value (@key_value_pairs) {
($key, $value) = split (/=/, $key_value);
$value =~ tr/+/ /;
$value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
if (defined($input{$key})) {
$input{$key} = join ("\0", $input{$key}, $value);
else {
$input{$key} = $value;

I got it as part of a resource CD I got at a seminar I went to, so I am not sure how it works. Here is my problem: I need to be able to read in the data (from the form) and perform mathematical opperations on it (mostly additions) and also comparisons of the values. I cannot seem to get the additions to work, and I was wondering if it had anything to do with conflicting data types?

Thanks in advance,


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives