Printing e-mail with '\' before '@'??
I need to know how to change an e-mail address from [email protected] to yourname\@domain.com. How do I do that?
NOTE: The e-mail address is coming from a form: $FORM{'email'} and is then being printed to a file, if that helps.
Thanks!!
--Edge
Ken Elliott posted this at 03:05 — 23rd August 2000.
They have: 358 posts
Joined: Jun 1999
If you are talking about taking it from a searching through a file and replaceing every occurance of "@" then you run this simple script.
#Script has not been tested so, check for errors that I miss. Sorry.
#!/usr/bin/perl -w
$thefile = "file.txt"
open (FILE, < "$thefile");
@contents = ;
close (FILE);
foreach $line(@contents){
$line =~ s/@//@/; # Don't even know if this will work.
}
Pimpin like a pimp with an electrofied pimpin machine!
Edge posted this at 03:53 — 23rd August 2000.
They have: 117 posts
Joined: Mar 2000
No, I'm talking about changing it before it even gets printed to the file.
--Edge
Edge posted this at 04:04 — 23rd August 2000.
They have: 117 posts
Joined: Mar 2000
Nevermind! I figured it out!!
For anyone who wants to know, just use this little snippet of code:
$FORM{'email'} =~ s/\@/\\\@/g;
Thanks for trying to help, though, VulKen!
--Edge
Ken Elliott posted this at 04:12 — 23rd August 2000.
They have: 358 posts
Joined: Jun 1999
Oh..ok. I just returned because I figured out a beter way to do what I was talking about. Now think you can answer my question in the thread below?
VulKen
Hit it long, but keep it short
Pimpin like a pimp with an electrofied pimpin machine!
Orpheus posted this at 04:55 — 23rd August 2000.
They have: 568 posts
Joined: Nov 1999
you could replace the "" that you print with to ''
that always works.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.