Okay, I'm posting this without working on it myself yet. It mainly is a challenge for those who have time to work on it now, and I'll hack away at it after work. (In about 7 hours or so.)

So the idea is this, I use fortune for a number of things; however there is an annoyance. The people who wrote the fortunes put newlines in for wrapping and such. Normally this wouldn't be a problem, if I was using fortune in a terminal, but in this case, it's a resizable window. So newlines within a quote should be removed, but others should stay.

So, to make this easier to explain I ran my fortune command a number of times and seperated the quotes by a line of "=". I then made a copy of it and corrected it by hand. The goal is to have a perl script do it for me.

Original Text:

Bender: Stay away from our women. You got metal fever, baby, metal fe +ver! =================================================================== Kids, kids, kids. As far as Daddy's concerned, you're both potential murderers. -- Homer Simpson Who Shot Mr. Burns? (Part 2) =================================================================== Wh ... what's going on? Wh ... wha ... why am I on a Japanese box? -- Homer Simpson In Marge We Trust =================================================================== Who spread garbage all over Flanders's yard before I got a chance to? -- Homer Simpson Two Dozen and One Greyhounds =================================================================== THIS IS NOT A CLUE...OR IS IT? THIS IS NOT A CLUE...OR IS IT? THIS IS NOT A CLUE...OR IS IT? THIS IS NOT A CLUE...OR IS IT? Bart Simpson on chalkboard in episode 2F16 =================================================================== "It was nice of you to let me reattach your arm." --Zoidber =================================================================== Calculon: An Oscar, you say? That would get me out of this festering rats' nest called television once and for all. =================================================================== Dasher, Dancer ... Prancer ... Nixon, Comet, Cupid ... Donna Dixon. -- Homer Simpson Simpsons Roasting on an Open Fire =================================================================== Homer: I suppose you want to probe me. Well, you might as well get it over with. Kang: Stop! We have reached the limits of what rectal probing can teach us. Treehouse of Horror VII Famous Original Ray's Superior Court =================================================================== It's okay, Marge. I've learned my lesson. A mountain of sugar is too much for one man. It's clear now why God portions it out in those tiny packets, and why he lives on a plantation in Hawaii. -- Homer Simpson Lisa's Rival =================================================================== Bender: "Tell the Donbot I'm quitting organized crime. From now on I'l +l stick to the regular kind." =================================================================== "Hurry up! I wanna see the moon." -Fry "Relax. It's open 'till nine." -Leela =================================================================== I WILL NOT SCREAM FOR ICE CREAM I WILL NOT SCREAM FOR ICE CREAM I WILL NOT SCREAM FOR ICE CREAM I WILL NOT SCREAM FOR ICE CREAM Bart Simpson on chalkboard in episode AABF03 =================================================================== Calculon: I'm programmed to be very busy. =================================================================== "I don't care how many eyes a man has... as long as it's less than fi +ve." -Leela

Fixed Text:

Bender: Stay away from our women. You got metal fever, baby, metal fe +ver! =================================================================== Kids, kids, kids. As far as Daddy's concerned, you're both potential +murderers. -- Homer Simpson Who Shot Mr. Burns? (Part 2) =================================================================== Wh ... what's going on? Wh ... wha ... why am I on a Japanese box? -- Homer Simpson In Marge We Trust =================================================================== Who spread garbage all over Flanders's yard before I got a chance to? -- Homer Simpson Two Dozen and One Greyhounds =================================================================== THIS IS NOT A CLUE...OR IS IT? THIS IS NOT A CLUE...OR IS IT? THIS IS NOT A CLUE...OR IS IT? THIS IS NOT A CLUE...OR IS IT? Bart Simpson on chalkboard in episode 2F16 =================================================================== "It was nice of you to let me reattach your arm." --Zoidber =================================================================== Calculon: An Oscar, you say? That would get me out of this festering +rats' nest called television once and for all. =================================================================== Dasher, Dancer ... Prancer ... Nixon, Comet, Cupid ... Donna Dixon. -- Homer Simpson Simpsons Roasting on an Open Fire =================================================================== Homer: I suppose you want to probe me. Well, you might as well get + it over with. Kang: Stop! We have reached the limits of what rectal probing can +teach us. Treehouse of Horror VII Famous Original Ray's Superior Court =================================================================== It's okay, Marge. I've learned my lesson. A mountain of sugar is too + much for one man. It's clear now why God portions it out in those t +iny packets, and why he lives on a plantation in Hawaii. -- Homer Simpson Lisa's Rival =================================================================== Bender: "Tell the Donbot I'm quitting organized crime. From now on I'l +l stick to the regular kind." =================================================================== "Hurry up! I wanna see the moon." -Fry "Relax. It's open 'till nine." -Leela =================================================================== I WILL NOT SCREAM FOR ICE CREAM I WILL NOT SCREAM FOR ICE CREAM I WILL NOT SCREAM FOR ICE CREAM I WILL NOT SCREAM FOR ICE CREAM Bart Simpson on chalkboard in episode AABF03 =================================================================== Calculon: I'm programmed to be very busy. =================================================================== "I don't care how many eyes a man has... as long as it's less than fi +ve." -Leela

Something to remember, not only spaces are used, but also tabs, so be aware of that.

There are really only a couple of tasks here:


==
Kwyjibo. A big, dumb, balding North American ape. With no chin.

In reply to Removing Preformatted Word Wrapping by abitkin

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.