I have the code:
$TEMP =~ s/\#NAME\#/$customerName/g;
Where I am replacing #NAME# with the value in $customername using Regex. What I want to do is append a variable onto the end of NAME.
So I want to do something like:
$TEMP =~ s/\#NAME . $appendValue\#/$customerName/g;
so it will essentially be:
$TEMP =~ s/\#NAME_1\#/$customerName/g;
Would this work or is there a proper way to handle this?
Test Cases:
- Hello #NAME#
- This is only intended for #NAME#
#is not a metacharacter (and therefore doesn't need to be escaped), and you probably want to use\Q...\Eto quote any potential metacharacters contained inside your variable. Have you tried anything yet?