I have an input string in the format key=value and the value always ends with a line break i.e. \n. I need to double quote the value part of my string, excluding the line break and I did the following to do that, but, for some reason, the equal to operator isn't registering in my substitue operation; my output remains the same as input even after the substitute operation. How can I achieve this?
#input string: parameter=TO_DATE('1900-01-01','YYYY-MM-DD')\n #desired output: parameter="TO_DATE('1900-01-01','YYYY-MM-DD')"\n $input_string =~ s/"="/"=\""/esg; $input_string =~ s/"\n"/"\"\n"/esg; print "$input_string";
In reply to replacing equal to operator by ty_sopw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |