I'm guessing most of you have seen this much-forwarded email?
Aoccdrnig to a rscheearch at an Elingsh uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is that frist and lsat ltteer is at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae we do not raed ervey lteter by it slef but the wrod as a wlohe.

It's an interesting phenomenon, but who wants to play golf with the process to put regular text into this strange form of mangled but still readable text?

The first and last letters must be correct, and the rest of the letters must be out of order.

Here's a version I'm totally not proud of but I put it together in a few minutes.

sub mangle { my $input = shift (); my @words = split ('\s', $input); foreach my $item (@words) { my $punctuation = ''; if($item =~ s/(\.|,)$//){ $punctuation = $1; } if (length($item) > 3) { $item =~ m/^(.)(.+?)(.)$/; my $centre = $2; while ($centre eq $2) { my @centre = split ('', $2); shuffle(@centre); $centre = join ('', @centre); } $item = $1 . $centre . $3 . $punctuation; } else { $item .= $punctuation; } } return join (' ', @words); } ### NB: shuffle routine is not my work. sub shuffle { my $i = @_; # length of @_ array while ($i) { my $j = rand $i--; @_[ $i, $j ] = @_[ $j, $i ]; # 0 <= int($j) <= $i } }


($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss') =~y~b-v~a-z~s; print

In reply to Txet Maglning Glof, Ayobndy? by Cody Pendant

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.