Hello Monks,

I'm a bit confused why this isn't working the way it should. I'm probably just tired and making a careless mistake, but I just don't see it. Suppose the following:
# the following message will be sent to the specified recipient in ord +er # to promote the site. the following markers may be used anywhere in # the message # # <RECP_NAME> - will be replaced with the recipient's name # <SEND_NAME> - will be replaced with the sender's name # <SITE_URL> - will be replaced with the site url variable from above # my $message2 = ' Hey <RECP_NAME>, I was surfing the web and I stopped by a pretty cool site that I think + you might be interested in. It is filled with cool information, good link +s, funny pics, and more, so be sure to check it out! Here is the address of the site: <SITE_URL>. <SEND_NAME> <SEND_EMAIL> ';
Now if I had the following lines of code, shouldn't the appropriate replacements be made?
$message1 =~ s/<RECP_NAME>/$$formdata{'recp_name'}/ig; $message1 =~ s/<SEND_NAME>/$$formdata{'send_name'}/ig; $message1 =~ s/<SITE_URL>/$site_url/ig;
Everything gets replaced by the <SITE_URL>; that gets left for some reason. I do something similar to another string and half of the cases get replaced, while half of them don't. Does anyone see what I'm doing wrong?

In reply to string substitution help by emilford

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.