Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to insert character to perl string

Status
Not open for further replies.

michael12

Programmer
Sep 26, 2002
25
US
because sendmail use the format "name\@hostname.com", I use the form to collect email address "name@hostname.com", how to insert character "\" into the email address?
 
Code:
$email = 'somename@host.com';
$email =~ s/@/\\@/g;
print $email; # prints somename\@host.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top