Double negatives in code always confuse me a bit... You have these two conditions:
if (!($MailFrom =~/\@*\./)) {
$kill = 1;
print "Invalid return address in From box.
";
}
if (!($MailTo !~/\@*\./)) {
$kill = 1;
print "Invalid destination address...
";
}
The following pseudo-code properly "translates" this logic, so the question is: does it also express your true intent?
- if the "from" parameter string contains at least a single period (dot) character, which optionally follows "@", then it's okay, otherwise, complain about it.
- if the "to" parameter string does not contain a period, which optionally follows "@", then it's okay, otherwise complain about it.
Now if the criterion is supposed to be "@" followed by period, you should not have the asterisk after "@" -- this means "zero or more occurrences" of "@" preceding a period, so both "." and "@." match your /\@*\./ regex (but neither of them looks good to me as an email address).
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.