Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^5: no reaction on string replace

by poj (Parson)
on Sep 11, 2013 at 20:14 UTC ( #1053559=note: print w/replies, xml ) Need Help??


in reply to Re^4: no reaction on string replace
in thread no reaction on string replace

You don't need the foreach loop as you have for @lines.
#!/usr/bin/perl -w use strict; my $SCU = 'C:/Users/Desktop/a.txt'; open (FILE, '<', $SCU) or die "$SCU File not found : $!"; my @lines = <FILE>; close (FILE); 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);
poj

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1053559]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2016-09-26 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (478 votes). Check out past polls.