#!/usr/bin/perl -w use strict; my $email = 'user@company.com'; # this will replace all @'s - add option of (2) to split to replace on +ly one print join( '\@', split( '\@', $email ) ), "\n"; # this will replace only one - add g to replace all $email =~ s/@/\\@/; print $email, "\n";
In reply to Re: Having a problem replacing "@" with "\@"
by Transient
in thread Having a problem replacing "@" with "\@"
by TASdvlper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |