On 8/4/01 12:11 PM, Steven MysticPoet wrote:
> i need to search for &member& in a textarea and replace it with the contents
> of $member. how can i do this? im really quite new to this. :)
>
> im pretty sure that this will search it out
>
> $textarea =~ s/&member&/I;
>
> will search it out, but not sure on how to replace it when the script sends
> the email.
>
This will search it out:
$textarea =~ m/&member&/i;
But to do a search/replace, you'd do:
$textarea =~ s/&member&/$member/i;
Remember that that will only search and replace the FIRST occurance of
&member&. To do it more than once you need to use the /g (Global) modifier:
$textarea =~ s/&member&/$member/ig; #/ig instead of just /i
-Michael Kelly
Email: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]