s/@/\/@/g; #### $string = "foo\@bar.com"; # or better yet: $string = 'foo@bar.com';