Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^5: no reaction on string replace

by poj (Priest)
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


Comment on Re^5: no reaction on string replace
Select or Download Code

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 chilling in the Monastery: (11)
As of 2014-10-30 14:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls