Hello! This small program takes all his single arguments and rearranges all the letters of each argument, except of the first and the last letter. This way, all sentences sound like drunken. Example:
perl drunken.pl I think it is funny that people still understand this +sentence I tnihk it is fnnuy taht pploee slitl usnretadnd tihs scnetnee
And here is the program:
use strict; $| = 1; for (@ARGV) { s/(.?)(.*)(.\W*)$/$2/; print $1; my ( $l, @w ) = ( $3, reverse split // ); print splice @w, rand $#w - 1, 1 while $#w + 1; print "$l "; } print "\n";
Who has a better solution? Don't ask for a sense ;)

Update: Waht deos bteter mnae? Wlle, wt'ahs better for yuo. Mbyae snoenoe lekis to hvae lses cedo, the nxet one lekis to hvae it mroe ousacetfbd.

Update 2: I wrote a small plugin for Irssi which makes you write like a drunken man ;)

Update 3: Changed the link of the plugin into a link which will never be obsolet.

Update 3b: Sorry, changed the link again :( But it should stay now this way :)

Paul C. Buetow

In reply to Drunken words by buetow

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.