Could this sub be doing it? (i notice "remove any spaces")
############################# Subroutines ########################### ### PARSE SUBROUTINE sub parse_formx { local ($name, $value, $pair, $buffer, @pairs); if ($ENV{'REQUEST_METHOD'} eq 'GET') { # Split the name-value pairs @pairs = split(/&/, $ENV{'QUERY_STRING'}); } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { # Clear buffer and Get the input $buffer = ""; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); }else { &error("Bad request method, Use POST or GET"); exit; } #determine name and variable for each pair foreach $pair (@pairs) { # Split into name and value. ($name, $value) = split(/=/, $pair); # Ignore The Submit Button if($name =~ /submit/i) { next; } $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + + + # Remove Any Possible System Shell Commands Or SSI's Etc. $name =~ s/~!/ ~!/g; $name =~ s/<!--(.|\n)*-->//g; $value =~ s/~!/ ~!/g; $value =~ s/<!--(.|\n)*-->//g; $value =~ s/^\s+//gms; # remove any leading spaces $value =~ s/\s+$//gms; # remove any trailing spaces $value =~ s/\s{2,}/ /gms; # remove any 2 spaces and put o +nly 1 $value =~ s/\|//g; # removes any Intruder tamperin +g $value =~ s/~//g; $value =~ s/\`//g; # removes any server side inclu +des $value =~ s/\~//g; # removes any server side inclu +des $value =~ s/\"//g; # removes quotes $value =~ s/\;//g; # removes html $value =~ s/\<//g; # removes html $value =~ s/\>//g; # removes html $value =~ s/\s+//g; # remove any spaces $value =~ s/^[\s]+|[\s]+$//gm; # remove any spaces $FORM{$name} = $value; } return %FORM; } # end of sub

In reply to Re^2: Perl form user input by Anonymous Monk
in thread Perl form user input by JamesBond007

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.