Here's a less cumbersome way :-)
use strict; use warnings; use Tie::File; tie my @xfil, 'Tie::File', 'var.txt' or die $!; @xfil = map { s/the line to be replaced/this is the new line/; $_ } @x +fil; untie @xfil;
-- Ken
In reply to Re: A Better Way
by kcott
in thread A Better Way
by toniax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |