in reply to Re^3: no reaction on string replace
in thread no reaction on string replace
It is still no working. Can you tell me what I messed up? Thank you!#!/usr/bin/perl -w use strict; my $SCU= 'C:/Users/Desktop/a.txt'; open(FILE, "<$SCU") || die "File not found"; my @lines = <FILE>; close(FILE); #my $copy = $_; my @newlines; foreach(@lines) { push @newlines, s/<test>/xyz/rg for @lines; } open (FILE, ">", "$SCU") or die "Could not open file $SCU: $!"; print FILE @newlines; close(FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: no reaction on string replace
by poj (Abbot) on Sep 11, 2013 at 20:14 UTC | |
|
Re^5: no reaction on string replace
by Eily (Monsignor) on Sep 11, 2013 at 21:33 UTC |