my $fil = 'file.txt'; open(DATA, "$fil") || die "Can not open: $!\n"; my @dat = (<DATA>); close(DATA); open(DATA, ">$fil") || die "cant write: $!\n"; foreach (@dat) { if($_ =~ /number/) { s/number/NEWWORD/; print DATA $_; } } close(DATA);
In reply to Re: Re: Deleting a line out of text file
by Anonymous Monk
in thread Deleting a line out of text file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |