use strict; open(INFILE, "/path/to/file"); my @lines = map {s/oldthing/newthing/ if(m/myLine/);$_;} <INFILE>; close(INFILE); open(OUTFILE, ">/path/to/file"); print OUTFILE $_ foreach(@lines); close(OUTFILE);
In reply to Re: Use of grep and foreach
by tcf22
in thread Use of grep and foreach
by monaLisa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |