> perl $function_used = "memcpy"; $function_call = "memcpy(a, b, sizeof(a));" $function_call =~ s/$function_used//g; Scalar found where operator expected at - line 3, near "$function_call" (Missing semicolon on previous line?) syntax error at - line 3, near "$function_call " Execution of - aborted due to compilation errors. #### > perl $function_used = "memcpy"; $function_call = "memcpy(a, b, sizeof(a))"; $function_call =~ s/$function_used//g; print $function_call; __END__ (a, b, sizeof(a))