$ perl -le '$_="abc def"; print; s/\G\w/X/g; print' abc def XXX def