in reply to Re: In place editing of text files
in thread In place editing of text files
this seems to work fine.#!perl -w use strict; my $line; my @array; my $CTLfile = 'y:\perl\test.ctl'; open (CTLHANDLE, "<$CTLfile"); @array = <CTLHANDLE>; close(CTLHANDLE); open (CTLHANDLE, ">$CTLfile"); foreach $line(@array){ $line =~ s/SOURCEREPOSITORYNAME/SOURCEREPOSITORYNAME=Development/g +; print CTLHANDLE "$line"; } close(CTLHANDLE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: In place editing of text files
by ig (Vicar) on May 29, 2009 at 00:15 UTC |