perl one liners begin with -e Posted on October 24, 2008 by freegnu perl -e '$hw="hello world";$hw=~s/^(h)([^w]*)(w)(.*)$/H$2W$4\n/;print $hw'