in reply to Change utility; code optimization
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Change utility; code optimization
by chipmunk (Parson) on Feb 13, 2001 at 00:16 UTC | |
by gryphon (Abbot) on Feb 13, 2001 at 04:16 UTC | |
by chipmunk (Parson) on Feb 13, 2001 at 10:02 UTC |