Aside from the cgi_lib stuff (move to CGI.pm as soon as you can), I'm not sure you're opening sendmail right. perlfaq9 gives the example code:
open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq") or die "Can't fork for sendmail: $!\n"; print SENDMAIL <<"EOF"; From: User Originating Mail <me\@host> To: Final Destination <you\@otherhost> Subject: A relevant subject line Body of the message goes here after the blank line in as many lines as you like. EOF close(SENDMAIL) or warn "sendmail didn't close nicely";
I would change the To: line to include your address. Also, using a here doc makes your code look much neater. I'd also rethink the value of putting every parameter from the order page in one hash -- if you use a couple of different scalars and one big array, you won't have to go through that long section in the middle accessing each hash key directly. Specifically, make an array for orders, and join the the quantity, item, description, price, and total in each slot. Then just do a foreach loop over that array, and print each line to the MAIL filehandle.

To debug this (as I'm not sure the ReadParse() subroutine is doing what you think it should), comment out the lines opening sendmail, and open the MAIL filehandle to print to a file somewhere, then run the program again. If you get what you'd normally expect in the e-mail, your problem is in the way you're opening sendmail. If you don't get what you expect in the file, you're probably not decoding the QUERY_STRING the way you expect. (That join statement just looks funny to me....)


In reply to YIKES! by chromatic
in thread Getting response from a form by Anonymous Monk

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.