I tried your code with the following setup:
INST_FILE /usr/local/lib/perl5/5.8.0/Text/Wrap.pm
INST_VERSION 2001.0929
and with the following sample data file:
Here is a sample file that contains longish lines of text to
be wrapped. It also contains really long words, for example:
superantidisestablishmentarianismabilityness, which weighs in
at 45 characters (I think), counting the comma.
and that yielded the following:
Here is a sample file that contains
longish lines of text to
be wrapped. It also contains really
long words, for example:
superantidisestablishmentarianismabilit
yness, which weighs in
at 45 characters (I think), counting
the comma.
(Note that the last six characters of the long word were wrapped to the next line -- not five -- because Text::Wrap's notion of "column width" includes the line termination as part of the maximum allowed length.)
So, I'm not seeing the problem you mention (the big word didn't just disappear -- it's still there, and is split into pieces according to the allowed max width). Maybe there's some other step in trip to your palm pilot where something is getting lost?
Personally, I find the "picket-fence" effect demonstrated with my test file to be really annoying -- it works better if you do chomp @text; before passing the array to "wrap()".
update: BTW, I assume your real code does print FH wrap(...); -- not just "print wrap(...)". |