in reply to Re: Re: Re: Re: Re: Re: Re: Code review: validation regexes
in thread Code review: validation regexes

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.....