Hagbone has asked for the wisdom of the Perl Monks concerning the following question:
It wraps (on word boundaries), BUT when it encounters a lone newline (a blank line), it's adding a space at the end of the line preceding the lone newline, and adding a space at the beginning of the line following the lone newline.$Text::Wrap::columns = '40'; print wrap("","",@CONTENT);
The spaces are eliminated, but that sure is inefficient (and ugly). It seems something's going on with line feeds that I don't understand.$Text::Wrap::columns = '40'; push(@YO, wrap("","",@CONTENT)); foreach (@YO) { $_ =~ s/(\s)?\n\s/\n/g; print; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Text::Wrap - having problems with long words
by sauoq (Abbot) on Jan 17, 2003 at 21:36 UTC | |
by Hagbone (Monk) on Jan 17, 2003 at 23:05 UTC | |
by Hagbone (Monk) on Jan 18, 2003 at 16:12 UTC | |
by poj (Abbot) on Jan 18, 2003 at 17:25 UTC | |
by graff (Chancellor) on Jan 18, 2003 at 05:09 UTC | |
by Hagbone (Monk) on Jan 18, 2003 at 14:51 UTC |