Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Re: Re: Re: Re: Re: Re: Code review: validation regexes

by l2kashe (Deacon)
on Jul 10, 2003 at 16:04 UTC ( [id://273027]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://273027]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-16 05:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found