Like sauoq, I have tried but failed to reproduce the results you reported -- either of them -- using the four paragraphs you cited. I am assuming that given this text, @CONTENT should have 7 elements (maybe 8, at most 9, if you have blank lines at the beginning and/or end of the array):
1: "This program ... details.\n" 2: "\n" 3: "You should have ... provide one.\n" 4: "\n" 5: "You should also ... /gpl.html.\n" 6: "\n" 7: "For those ... to use that.\n"
(update: added "\n" at the end of each text line, just to be clear about that; also fixed the summary of output below.) Given data like that, and using these lines of code:
$Text::Wrap::columns = '40'; print wrap( '','',@CONTENT );
I get the following sequence of paragraphs (summarized):
This program is distributed in the hope ... ## 5 lines ## ... Artistic License for more details. You should have received a copy of the ... ## 2 lines ## ... glad to provide one. You should also have received a copy of ... ## 6 lines ## ... on the internet at http://www.gnu.org/copyleft/hhhhhhhhhhh hh/hhhhhhhhhhhhhhhhhh/gpl.html. For those of you that choose to use the ... ## 37 lines ## ... protection, so you may prefer to use that.
So it looks like the URL is being rendered where it should be. Also, when I pipe the output through "od -a", I see that the paragraph boundaries (the blank lines) are rendered as two consecutive "nl" (\n) characters, with no extra spaces. (But frankly, if there were extra spaces, I don't know why this would be a problem.)

The only thing I would consider fixing is to have the URL be broken after a slash character, rather than in the middle of a "word" token, but that probably doesn't matter.

My Perl installation is v5.8.0 built for i686-linux, and I'm using the "2001.0929" version of Text::Wrap. What are you using, and how, exactly, are you filling the @CONTENT array?


In reply to Re: Re: Re: Text::Wrap - having problems with long words by graff
in thread Text::Wrap - having problems with long words by Hagbone

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.