emilford has asked for the wisdom of the Perl Monks concerning the following question:
Now if I had the following lines of code, shouldn't the appropriate replacements be made?# 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> ';
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?$message1 =~ s/<RECP_NAME>/$$formdata{'recp_name'}/ig; $message1 =~ s/<SEND_NAME>/$$formdata{'send_name'}/ig; $message1 =~ s/<SITE_URL>/$site_url/ig;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: string substitution help
by merlyn (Sage) on Sep 23, 2002 at 02:54 UTC | |
by emilford (Friar) on Sep 23, 2002 at 12:53 UTC | |
|
•Re: string substitution help
by merlyn (Sage) on Sep 23, 2002 at 02:43 UTC |