We help IT Professionals succeed at work.

make it lower case.

MAXcom
MAXcom asked
on
235 Views
Last Modified: 2010-03-05
Here is my script so far:

#!/usr/bin/perl
use CGI;

$query= CGI->new();
$email = $query->param('email');
$passwd = $query->param('password');

print "Content-type: text/html\n\n";


as you see, im taking an email and a password from a form submitted by the user. How do I make $email and $passwd lower case as a standard?
Comment
Watch Question

$email=~tr/[A-Z]/[a-z]/;
$passwd=~tr/[A-Z]/[a-z]/;
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Top Expert 2009

Commented:
#try using the lc (lowercase) function:
$email = lc($email);
$passwd = lc($passwd);

#or simply
$email = lc($query->param('email'));
$passwd = lc($query->param('password'));

if that is what you mean. Unless you mean something else with "standard"?

Greetz,
Abel

Author

Commented:
looks good to me. thanks
Further...
$email = lc $query->param('email');
$passwd = lc $query->param('password');

Aren't choices wonderful!

Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.