You should use warnings; Because the default for filehandle is *input*. So when you write open(FILE, "$S") you open the file for reading. You should have been warned about that.
@lines = <FILE> makes a copy of the file content, but for(@lines) doesn't make any copy, inside the for loop $_ is not a copy of a line, it's the line itself. So in the end @lines and @newlines are certainly the same.
In reply to Re: no reaction on string replace
by Eily
in thread no reaction on string replace
by semipro
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |