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;
In reply to Re: match a line and edit it
by toolic
in thread match a line and edit it
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |