Results 1 to 2 of 2

Thread: Can anyone help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85

    Question

    if ($ENV {'REQUEST_METHOD'} eq 'POST') {
    read(STDIN, $buffer, $ENV {'CONTENT_LENGTH'});
    @pairs = split (/&/, $buffer);
    foreach$pair(@pairs) {
    ($name, $value) = split (/=/, $pair);
    $value =~ tr/t/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack ("C", hex ($1))/eg;
    $FORM{$name} = $vaule;
    }
    }

    I have just started in CGI/Perl programming and would like to know what this code does. I sort of know what I think it is trying to do, but I'm not sure. If someone could explain it to me that would be so great.

    Thanks for the help in advance.
    Using VB6 Still Pluging away

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    It converts the query string:
    Code:
    ?action=newreply&threadid=27509
    or similar...

    into an associative array:
    $FORM{'action'} = "newreply"
    $FORM{'threadid'} = "27509"
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width