in reply to Re^2: Help editing a file based off seach criteria
in thread Help editing a file based off seach criteria
You could use a loop instead of using grep, and keep a counter to remember the line number, or just remember not only the current line but also the line before it.
my @list = <DATA>; chomp @list; my $prev_line; for my $line (@list) { # Look at current line # remember this line as "previous" };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Help editing a file based off seach criteria
by perlnewb123 (Sexton) on Jan 13, 2009 at 15:52 UTC | |
by Corion (Patriarch) on Jan 13, 2009 at 15:55 UTC | |
by perlnewb123 (Sexton) on Jan 13, 2009 at 16:47 UTC | |
by Corion (Patriarch) on Jan 13, 2009 at 17:12 UTC | |
by perlnewb123 (Sexton) on Jan 13, 2009 at 17:26 UTC | |
|