my @ar = qw/NEAR LANE EARS AREA/ ; # @ar = qw/LINGO MILLS SMOCK IDIOM LOGIC/; print "$_\n" for Z(@ar); sub Z{ while(1){@l=map{splice@_,rand@_,1}@_;@_=@l;return@_ if join('',reverse@l)eq join'',map{map{chop}@l}@l} }