Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
After reviewing other posts, perhaps I am in need of the seek command?use strict; my $file; $file="/text_file.txt"; open (FILE,"+<$file"); while( <FILE>) { if ($_ =~ /line 2/i) { print FILE "replacement text\n"; } } close FILE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Modifying lines of text
by dragonchild (Archbishop) on Oct 09, 2003 at 18:33 UTC | |
by Aragorn (Curate) on Oct 09, 2003 at 19:23 UTC | |
by dragonchild (Archbishop) on Oct 09, 2003 at 19:43 UTC | |
|
Re: Modifying lines of text
by thens (Scribe) on Oct 09, 2003 at 18:12 UTC | |
|
Re: Modifying lines of text
by MidLifeXis (Monsignor) on Oct 09, 2003 at 18:21 UTC |