in reply to Re: no reaction on string replace
in thread no reaction on string replace
#!/usr/bin/perl -w use strict; my $SCU='C:/Users/name/Desktop/a.txt'; open(FILE, "<$SCU") || die "File not found"; my @lines = <FILE>; close(FILE); my @newlines; foreach(@lines) { $_ =~ s/<ABCD>/xyz/g; push(@newlines,$_); } open(FILE, "$SCU") || die "File not found"; print FILE @newlines; close(FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: no reaction on string replace
by Eily (Monsignor) on Sep 10, 2013 at 21:42 UTC | |
by semipro (Novice) on Sep 11, 2013 at 19:27 UTC | |
by poj (Abbot) on Sep 11, 2013 at 20:14 UTC | |
by Eily (Monsignor) on Sep 11, 2013 at 21:33 UTC |