Well spoken :)

I also wasn't trying to offend, simply trying to extend the conversation a bit. Personally I think that threads like these will be beneficial for people passing through later, as they can see a few different sides of an issue and follow not only the technical reasoning, but also the stylistic reasoning for why this snippet is better in this case, over a different snippet.

With that said, I was glad to chat with you, and I think I'm done with this thread ;).

P.s: I've been thinking about the problem, and I think the way I would solve the particular issue of "reserved" usernames might be
my @reserved = qw(administrator mail-admin spam-admin); die "Please choose another name\n" if ( grep(/^$username$/i, @reserved +) );
A hash would also work, but then if you want $hash{$user}, you have to do your own manual case checking (or can force a particular casedness), or grep (/blah/i, keys %reserved), or possibly grep(/blah/, each %reserved)



MMMMM... Chocolaty Perl Goodness.....

In reply to Re: Re: Re: Re: Re: Re: Re: Re: Code review: validation regexes by l2kashe
in thread Code review: validation regexes by Anonymous Monk

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.