The statement "I recieved a lot of mocking" is false (as well as misspelled).

You received a lot of good advice at no charge.... but seem to have misunderstood or ignored most of it.

If this is merely an exercise, kudos for the improvements -- especially your decision to use a module to test addresses Note 1 -- but please don't take offense at explanations of your exercise's deficiencies. You're in the position of a small child poking a knife into an electric outlet, if you actually intend to use this "out in the wild." Rolling your own, even with the copious good advice you've received, is NOT an exercise for the beginner.

Please note that Email::Valid concerns itself chiefly with the validity of the form of the address -- testing it against RFC822 and, optionally, for a valid TLD (top level domain); for the presence of spaces and correcting them, if you specify that with fudge(); and for the existence of an MX or A record. But it's not checking subject, date or body for nasties, nor making any attempt to ensure that the mail actually originates (I'm sure there's a better term for that) at your server.

Just reading the code and pod for NMSFormMail (or, better yet, TFMail -- the .zip is available at http://nms-cgi.sourceforge.net/scripts.shtml) will illustrate some of the other aspects of making user input (somewhat) safe.

Note 1 Email::Valid's author assigns a version number of less than one -- typically, a signal that a module is a work-in-progress rather than something believed complete and stable.


In reply to Re: Is that a decent concept? by ww
in thread Is that a decent concept? by heatblazer

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.