in reply to Re: Fun with words (Golf?)
in thread Fun with words (Golf?)

using s/// to detect the punctuation, and it can be shorter still:
while(<DATA>){for(@x=split){s/([.,]?)$//;$s=substr$_,0,1,''; $e=chop;$s.=substr$_,rand(length),1,''while$_;$_="$s$e$1"} print"@x\n"}