in reply to modification of simple form-email script

use CGI; it takes care of your input from html forms and takes does your sub parseform{} for you. Throw away the sub parseform{} and look at the CGI module. Type 'cgi' into the search bar and read up on the docs.

UPDATE:
email.pl
this code is self explaintory, and eaisily modifiable.
#!/usr/bin/perl use CGI qw/:standard/; $to=param('to'); $from=param('from'); $fromhandle=param('fromhandle'); $subject=param('subject'); $contents=param('contents'); if (param()) { open(MAIL, "|/usr/sbin/sendmail -t") || die "cant open"; print MAIL "To: $to \nFrom: $from ($fromhandle)\n"; print MAIL "Subject: $subject \n\n"; print MAIL "$contents\n"; close(MAIL); print "Content-type: text/html\n\n"; print "To:$to<br>\n"; print "From:$from rather know as: \'$fromhandle\'<br>\n"; print "Subject: $subject<br>\n\n\n"; print "$contents"; } else { print "Content-type: text/html\n\n"; print <<EOF; <html><body> <form action="email.pl" method="post"> to:<br> <input type="text" name="to"><br> from:<br> <input type="text" name="from"><br> from handle:<br> <input type="text" name="fromhandle"><br> subject:<br> <input type="text" name="subject"><br> Contents:<br> <textarea name="contents" rows=30 cols=64></textarea> <input type="submit"> <input type="Reset"> </form> </body> </html> EOF }
-Silent11