use strict; use warnings; use List::Util qw( shuffle ); while () { s/(?<=\w)(\w+)(?=\w)/ join('', shuffle($1=~m{.}sg)) /eg; print; } __DATA__ I couldn't believe that I was actually understanding what I was reading. The phenomenal power of the human mind, according to research at Cambridge University, suggests that it doesn't matter in what order the letters in a word are, as long as the first and last letters are in the right place. The rest can be a total mess, and you can still read it without a problem. This is because the human mind does not read every letter by itself, but the word as a whole. Amazing, huh? Yeah, and I always thought spelling was important! Check apostrophe and punctuation: Jame's, They're, we'll they'd. #### shuffle($1=~m{.}sg) #### sort $1=~m{.}sg