vishy_acts has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I want to substitute '@' in email id with \@ .
I am processing one crontabe entry from our server which contains email id .
How to add escape character '\' before that so as to process it correctly .?
program:
$line="abc.xyz@lmnop.com"; $line=~s/\@/\\@/g; print "\n line is $line";
This is not giving correct result .
Thanks
Vishy
--------------------------------------------
I tried using Email::Address as follows
@addr=Email::Address->parse($line); $user=$addr->$user; print "\n $user";
---- this is not giving anything ---
i checked contents with perl -d ... addr is not getting created ...
please help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to substitute '@' in line
by johngg (Canon) on Apr 08, 2012 at 17:33 UTC | |
|
Re: how to substitute '@' in line
by Anonymous Monk on Apr 08, 2012 at 17:40 UTC | |
|
Re: how to substitute '@' in line
by snape (Pilgrim) on Apr 09, 2012 at 00:48 UTC |