Gossamer Forum
Home : General : Perl Programming :

forcing lowercase

Quote Reply
forcing lowercase
Hello,
If I have these two lines in a cgi script:

$Username = $FORM{'Username'};
$Username =~ s/\s//g;

The first line accepts the username, and the second line removes any blank spaces, now what can I do to force the username to all lowercase so that they cant enter something like User Name

Appreciate the help



------------------
Regards,
Visionary


Quote Reply
Re: forcing lowercase In reply to
$Username = lc $Username;

or

$Username =~ tr/A-Z/a-z/;

should do what you're looking for

--mark

------------------
Due to repeated requests for support via ICQ, I am once again offering support online.

The ONLY number I will accept requests on is #53788453. Messages sent to my other numbers will not pass through to me, as I have security settings set to ignore messages from users not on that list.

I don't know how often I will be active on this number, as it is for only when I am free to offer assistance.

Could this signature be any longer? :)
Quote Reply
Re: forcing lowercase In reply to
Thank you
Quote Reply
Re: forcing lowercase In reply to
Well done fair, for repeating what Mark said four hours earlier. Brilliant.

adam
Quote Reply
Re: forcing lowercase In reply to
i do lc($blah)

but whatever floats ur boat.

good luck Wink