in reply to A Better Way
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A Better Way
by toniax (Scribe) on Nov 04, 2010 at 17:34 UTC | |
by kcott (Archbishop) on Nov 04, 2010 at 18:10 UTC | |
by toniax (Scribe) on Nov 04, 2010 at 18:22 UTC | |
by kcott (Archbishop) on Nov 04, 2010 at 18:43 UTC | |
by toniax (Scribe) on Nov 04, 2010 at 22:13 UTC | |
by toniax (Scribe) on Nov 04, 2010 at 18:29 UTC | |
by toniax (Scribe) on Nov 04, 2010 at 18:53 UTC |