All,
I have a list of email addresses (user@company.com) in a configuration file, what I need to do is replace the "@" with "\@". I've tried regexp but couldn't get it to work, so I'm trying this:
$$email[0] = join('\@', split("@",$$email[0]));
Where $$email[0] is the email address. When I do the above, it actually replaced "@" with "\\@", I've tried:
$$email[0] = join("\\\@", split("@",$$email[0]));
and that doesn't work either. It substitutes "@" with "\\\@". This should be something simple to do, I just can't get a handle on it.
Well, thanks all. All solutions worked, and I actually had it working myself, but because I was printing out my hash table of email addresses using "Dumper" it must have automatically substituted "\@" with "\\@", but if I just print out a single hash element, it looks fine. Urgh ! I just didn't realize the output from using Dumper, looks slightly different. Hate when I do stuff like that.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.