parkinglot has asked for the wisdom of the Perl Monks concerning the following question:
My problem is as follows: I have the lines:
$function_used = "memcpy"; $function_call = "memcpy(a, b, sizeof(a));" $function_call =~ s/$function_used//g;
The problem is the $function_used isnt being treated as a variable (as you know). So how can one solve this? !!!!!!!!!!!! I solved this by removing the global identifier. !!!!!!!!!!!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Treating a variable as a variable in a regular expression?
by AnomalousMonk (Archbishop) on Jul 08, 2014 at 13:45 UTC | |
|
Re: Treating a variable as a variable in a regular expression?
by LanX (Saint) on Jul 08, 2014 at 13:37 UTC | |
|
Re: Treating a variable as a variable in a regular expression?
by InfiniteSilence (Curate) on Jul 08, 2014 at 13:13 UTC |