in reply to match a line and edit it
use strict; use warnings; use Tie::File; tie my @array, 'Tie::File', 'file.txt' or die $!; for (@array) { if (/foo/) { $_ = 'This is now bar'; } } untie @array;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: match a line and edit it
by Anonymous Monk on Mar 17, 2010 at 01:41 UTC | |
|
Re^2: match a line and edit it
by Anonymous Monk on Mar 17, 2010 at 23:33 UTC |