I have this input file:
text1
match
text2
match
text3
And I have this command:
perl -lpe 'print "prepend_me" if /^match$/' text.txt
And its output is:
text1
prepend_me
match
text2
prepend_me
match
text3
But I want:
text1
prepend_me
match
text2
match
text3
How do I get this?