1,$s/foo//
1,$p
.=
1,$s/bar/%/
1,$p
w
