Greetings all,
I've discovered something interesting. When running the above, I can enter "\n" in the change from field and the script will correctly interpret it to mean a newline character. When I enter "\n" in the change to field, the script incorrect interprets it to mean literally "\n" rather than a newline.
Looking at my code, I have a line near the end of the script:
$file_contents =~ s/$changefrom/$changeto/gi;
Can anyone explain why $changefrom is interpreted, but $changeto is not? Thanks.
-Gryphon.
In reply to Re: Change utility; code optimization
by gryphon
in thread Change utility; code optimization
by gryphon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |