Thanks for the tips :)

How does this look:

#!/usr/bin/perl #The path to the mail program on your system $mailprog = "/usr/sbin/sendmail"; # redirect page $redirect = "http://"; # Site url being referred $siteurl = "http://"; # Read the form read(STDIN, $input, $ENV{'CONTENT_LENGTH'}); # split the input @pairs = split(/&/, $input); # split the name/value pairs foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $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; $value =~ s/<([^>]|\n)*>//g; $FORM{$name} = $value; } # some variables $to = $FORM{'to'}; $tomail = $FORM{'tomail'}; $from = $FORM{'from'}; $frommail = $FORM{'frommail'}; $message = $FORM{'message'}; # make all first characters of names, uppercase @from = split(/ /, $from); @from = map ucfirst, @from; @to = split(/ /, $to); @to = map ucfirst, @to; # make the first letter of the message upper case $message = ucfirst($message); ############################################## # puts a period at the end of senders message, # if one was not there, AND, if there is no # question OR explanation mark. $message .= '.' if $message !~ /[.!?]$/; # do the mail... open (MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n"; print MAIL "From: $frommail\n"; print MAIL "To: $tomail\n"; print MAIL "Subject: @to, @from says check out $sitename!\n\n"; print MAIL "This is NOT spam! You were sent the email by @from ($fro +mmail),\nat IP: $ENV{'REMOTE_ADDR'}\n\n\n"; print MAIL "Hello @to, @from has sent you this email inviting you to + check out $siteurl\n\n\n"; print MAIL "@from also had this to say:\n$message\n\n\n" if ($messag +e ne ""); print MAIL "So check out $siteurl!"; close (MAIL); # redirect the browser print "Location: $redirect\n\n"; # tell me if they told #&told; exit; sub told { open (MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n"; print MAIL "To: toldafriend\@whatever.com\n"; print MAIL "From: toldafriend\@whatever.com\n"; print MAIL "Subject: $frommail (@from) told $tomail (@to)\n"; close(MAIL); }
Do I need the exit; line about "sub told" ??

In reply to Re: Re: Re: Re: Re: making first letter of all words in array upper case by iamrobj
in thread making first letter of all words in array upper case by iamrobj

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.