Help for this page
cat file1 echo --- cat file2
... --- perl output to stdout --- ... line3 line1 line2
perl -i -pe '$f||=s/opt=.*/opt=bar/; $_.="opt=bar\n" if !$f && !@ARGV +&& eof' files...