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"; }
In reply to Re: regular expression
by ikegami
in thread regular expression
by toniax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |