email email email
Posted: Wed Aug 03, 2005 6:41 am
Hi all,
was jus playing with some code i need to manipulate email address, this is just the beginning part. I need once the email is entered a switch is also used. U means upper case. WC means for all the . to be changed to / dot / and the @ changed to / at /.
The next switch is wc and does the reverse of the WC switch. This doesnt seem to work at all. and its buggin me.
Any help would be great
Thanks
Sami P
d11wtq | fixed U ==> U
was jus playing with some code i need to manipulate email address, this is just the beginning part. I need once the email is entered a switch is also used. U means upper case. WC means for all the . to be changed to / dot / and the @ changed to / at /.
The next switch is wc and does the reverse of the WC switch. This doesnt seem to work at all. and its buggin me.
Code: Select all
#!/usr/bin/perl
use strict;
use CGI ':standard';
my ($email, $switch, $up);
$email = param('email');
$switch = param('switch');
$up = uc($email);
print "content-type: text/html\n\n";
if (($email) && ($switch =~/U/)) {
print "$up\n";
}
elsif (($email =~ s/\./ dot /g) && ($email =~ s/\@/ at /g) && ($switch =~ /WC/)) {
print "$email\n";
}
elsif (($email =~ s/ dot /\./g) && ($email =~ s/ at /\@/g) && ($switch =~/wc/)) {
print "$email\n";
}Thanks
Sami P
d11wtq | fixed U ==> U