Professional Web Applications Themes

OT: Email syntax validation - PERL Beginners

>>>>> "Gunnar" == Gunnar Hjalmarsson <cc> writes: Gunnar> As a result of the thread "Check for valid email address", I have Gunnar> modified my emailsyntax() function to better conform to RFC 822. After Gunnar> all, I wouldn't like e.g. my contact form module to reject Randal when Gunnar> he has changed addresses. ;-) Gunnar> I skipped the specification's "domain-literal" alternative, at least Gunnar> for the time being. Gunnar> This is the modified function: Again, why aren't you just using Email::Valid? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <com> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, ...

  1. #1

    Default Re: OT: Email syntax validation

    >>>>> "Gunnar" == Gunnar Hjalmarsson <cc> writes:

    Gunnar> As a result of the thread "Check for valid email address", I have
    Gunnar> modified my emailsyntax() function to better conform to RFC 822. After
    Gunnar> all, I wouldn't like e.g. my contact form module to reject Randal when
    Gunnar> he has changed addresses. ;-)

    Gunnar> I skipped the specification's "domain-literal" alternative, at least
    Gunnar> for the time being.

    Gunnar> This is the modified function:

    Again, why aren't you just using Email::Valid?

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <com> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Randal Guest

  2. #2

    Default Re: OT: Email syntax validation

    Randal L. Schwartz wrote: [/ref]
    >
    > Gunnar> As a result of the thread "Check for valid email address", I have
    > Gunnar> modified my emailsyntax() function to better conform to RFC 822. After
    > Gunnar> all, I wouldn't like e.g. my contact form module to reject Randal when
    > Gunnar> he has changed addresses. ;-)
    >
    > Gunnar> I skipped the specification's "domain-literal" alternative, at least
    > Gunnar> for the time being.
    >
    > Gunnar> This is the modified function:
    >
    > Again, why aren't you just using Email::Valid?[/ref]

    I have already explained that:
    http://www.mail-archive.com/beginners%40perl.org/msg62450.html

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Guest

  3. #3

    Default Re: OT: Email syntax validation

    >> Again, why aren't you just using Email::Valid? 

    Faulty reasoning, the modules are available for public download to and
    if they don't have them they'll know it from the error you output about
    it informing them its needed and be able to install it quite easily

    perl -MCPAN -e 'install Email::Valid;'

    The advantages of it far outway the "they don't have to install a
    module" argument. That's what modules are for! :)

    Or you can always include the Email::Valid Module in the public script.

    That way they don't have to install the module and you can use solid
    consistent code.
    JupiterHost.Net Guest

  4. #4

    Default RE: OT: Email syntax validation

    Gunnar Hjalmarsson wrote: 
    >
    > I have already explained that:
    > http://www.mail-archive.com/beginners%40perl.org/msg62450.html[/ref]

    Interesting; if you visit that link, www.mail-archive.com evidently doesn't
    properly match RFC822 addresses either:

    No, that incorrectly invalidates


    fred&[EMAIL PROTECTED]


    which is a valid working address

    :~)
    Bob Guest

  5. #5

    Default Re: OT: Email syntax validation

    JupiterHost.Net wrote: 
    >>
    >> I have already explained that:
    >> http://www.mail-archive.com/beginners%40perl.org/msg62450.html[/ref]
    >
    > Faulty reasoning, the modules are available for public download to
    > and if they don't have them they'll know it from the error you
    > output about it informing them its needed and be able to install it
    > quite easily
    >
    > perl -MCPAN -e 'install Email::Valid;'
    >
    > The advantages of it far outway the "they don't have to install a
    > module" argument. That's what modules are for! :)[/ref]

    I hear that you have never distributed CGI scripts to people who
    typically have never heard of CPAN and don't have shell access, and to
    whom Perl and CGI are synonyms. That's the 'business' I am in.
     

    I do that with a few modules, but it makes installation harder and
    makes it more difficult to maintain my programs. Consequently, I avoid
    that trouble for trivial things. In this case we are talking about a
    simple input validation check, aiming to catch typos, and it would
    not justify that Email::Valid, as well as the non-standard modules
    it's dependent on, be included in the distribution.
     

    I believe that my modified function is "solid" and "consistent"
    enough, but I posted it in the hope to get some feedback on
    *the code*.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Guest

  6. #6

    Default Re: OT: Email syntax validation

    Bob Showalter wrote: 
    >>
    >> I have already explained that:
    >> http://www.mail-archive.com/beginners%40perl.org/msg62450.html[/ref]
    >
    > Interesting; if you visit that link, www.mail-archive.com evidently
    > doesn't properly match RFC822 addresses either:
    >
    > No, that incorrectly invalidates
    >
    >
    > fred&[EMAIL PROTECTED]
    >
    >
    > which is a valid working address
    >
    > :~)[/ref]

    Yeah, I noticed that, too. Randal should really think twice before
    including '&' in his real addresses. :)

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Guest

  7. #7

    Default Re: OT: Email syntax validation



    Gunnar Hjalmarsson wrote:
     
    >>
    >>
    >> Faulty reasoning, the modules are available for public download to
    >> and if they don't have them they'll know it from the error you
    >> output about it informing them its needed and be able to install it
    >> quite easily
    >>
    >> perl -MCPAN -e 'install Email::Valid;'
    >>
    >> The advantages of it far outway the "they don't have to install a
    >> module" argument. That's what modules are for! :)[/ref]
    >
    >
    > I hear that you have never distributed CGI scripts to people who[/ref]

    You hear? From who? Who told! :)
     

    I have actually but I educate them briefly on the benefits and then we
    use FTP if need be ;p
    Plus if I had host that wasn't willing to install Email::Valid for me so
    I could use it in a script, I'd dump 'em fast :)
     

    Bummer :)
     
    >
    > I do that with a few modules, but it makes installation harder and
    > makes it more difficult to maintain my programs. Consequently, I avoid
    > that trouble for trivial things. In this case we are talking about a
    > simple input validation check, aiming to catch typos, and it would
    > not justify that Email::Valid, as well as the non-standard modules
    > it's dependent on, be included in the distribution.

    >
    >
    > I believe that my modified function is "solid" and "consistent"
    > enough, but I posted it in the hope to get some feedback on
    > *the code*.[/ref]

    cool, sometimes the paradigm needs changed though and not the code :)

    I'm happy if you're happy!
    JupiterHost.Net Guest

  8. #8

    Default Re: OT: Email syntax validation

    JupiterHost.Net wrote: 
    >
    > You hear? From who? Who told! :)[/ref]

    Well, that was the only explanation I could figure out to your firm
    opinion in the matter.
     
    >
    > I have actually but I educate them briefly on the benefits and then
    > we use FTP if need be ;p[/ref]

    Sorry if I was presumptive, but I still believe we are talking about
    different target audiences.
     

    The users of my programs may have other priorities.
     
    >
    > cool, sometimes the paradigm needs changed though and not the code
    > :)
    >
    > I'm happy if you're happy![/ref]

    When people undiscriminatingly advocate the use of modules whenever
    possible, I get unhappy. I'm using modules when I consider it to be
    suitable.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Guest

  9. #9

    Default Re: OT: Email syntax validation

     

    Peace my friend, do whatever you want.
    It wasn't an attack, that's what the smiley's are for :)

    Chill chill chill ;p
    JupiterHost.Net Guest

  10. #10

    Default Re: OT: Email syntax validation

    JupiterHost.Net wrote: 
    >
    > Peace my friend, do whatever you want. It wasn't an attack, that's
    > what the smiley's are for :)[/ref]

    I didn't think you were attacking me. I thought we were discussing the
    use of modules in Perl programs in general, and in scripts distributed
    to 'non Perl-geeks' in particular.

    Smileys are nice, but they don't change the fact that we seem to have
    slightly different views on the matter, right? ;-)

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Guest

  11. #11

    Default Re: OT: Email syntax validation



    Gunnar Hjalmarsson wrote:
     
    >>
    >>
    >> Peace my friend, do whatever you want. It wasn't an attack, that's
    >> what the smiley's are for :)[/ref]
    >
    >
    > I didn't think you were attacking me. I thought we were discussing the
    > use of modules in Perl programs in general, and in scripts distributed
    > to 'non Perl-geeks' in particular.
    >
    > Smileys are nice, but they don't change the fact that we seem to have
    > slightly different views on the matter, right? ;-)[/ref]

    ok
    JupiterHost.Net Guest

  12. #12

    Default Re: OT: Email syntax validation

    >>>>> "Gunnar" == Gunnar Hjalmarsson <cc> writes:

    Gunnar> I hear that you have never distributed CGI scripts to people who
    Gunnar> typically have never heard of CPAN and don't have shell access, and to
    Gunnar> whom Perl and CGI are synonyms. That's the 'business' I am in.

    Then cut and paste the relevant parts of Email::Valid (a proven
    solution) into your script. The license permits that.

    Still faulty reasoning to think you need to "reinvent it", and a waste
    of our time to vet your new solution. Silly person.

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <com> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Randal Guest

  13. #13

    Default Re: OT: Email syntax validation

    >>>>> "Gunnar" == Gunnar Hjalmarsson <cc> writes:

    Gunnar> Yeah, I noticed that, too. Randal should really think twice before
    Gunnar> including '&' in his real addresses. :)

    This is why I have to fight the continual battle. Too many websites
    are borked.

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <com> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Randal Guest

Similar Threads

  1. Syntax validation
    By Nuno in forum MySQL
    Replies: 12
    Last Post: February 14th, 10:04 AM
  2. No syntax control during webservice validation in Visual Studio 8
    By worm@matfyz.cz in forum ASP.NET Web Services
    Replies: 3
    Last Post: March 20th, 09:56 AM
  3. Email Validation
    By sandramcewen in forum Macromedia Flex General Discussion
    Replies: 11
    Last Post: August 19th, 03:46 PM
  4. Validation for email
    By bpilots in forum Macromedia ColdFusion
    Replies: 2
    Last Post: March 15th, 09:13 PM
  5. Syntax for dynamic validation control
    By Chris Kennedy in forum ASP.NET Building Controls
    Replies: 1
    Last Post: June 8th, 09:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139