in reply to regular expression
The idea is to insert 'hello' after the marker line. For each line, it either prints the line plus hello (if it's the marker line) or just the line. The loop body could be written better as
print FILE $line_in; if ($line_in =~ /The marker line/) { print FILE "hello\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regular expression
by CountZero (Bishop) on Oct 31, 2010 at 17:37 UTC | |
by ikegami (Patriarch) on Nov 01, 2010 at 15:58 UTC |