I would like to do the equivalent of:
for (int i = 0; i < 10; i++)
{
arg[i] = arg[i].Replace("$", @"\$");
}
in Perl. What would this look like in Perl?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If it is only dollar sign
$you wish to escape I would go with depesz’s solution with a simple substitution. However, perl has a built-in function to handle escaping meta characters,quotemeta:Note that this escapes all meta characters, which may not be what you want.