tr/a-zA-Z/ /cs; split; foreach $_ (@_){ /^[aeiou]\S*/ ? $_ .="way " : s/(\S)(\S*)/$2$1ay /; print; }