First, thanks for you efforts ... this really is puzzling.
OK - I fooled around, and found an approach that eliminates the spaces, but not the "over the limit" word.
FWIW, I'm using Perl 5.00503 (OS solaris), and don't know the Text::Wrap version (I've no root access, but could find out the version if it ends up being critical).
When I read the file into a variable (rather then an array), the spaces do not appear, but the long URL still gets moved to the end of the output.
If I use:
open (FILE,"<$script_path/$file") || die "NFG1 $script_path/$file!\n";
@CONTENT = <FILE>;
close(FILE);
$Text::Wrap::columns = '40';
print wrap("","",@CONTENT);
The spaces show up. If I use:
open (FILE,"<$script_path/$file") || die "NFG1 $script_path/$file!\n";
while (<FILE>){
$CONTENT .= $_;
}
close(FILE);
$Text::Wrap::columns = '40';
print wrap("","",$CONTENT);
The spaces no longer appear, but again, the long URL is tossed in at the bottom. Here's how the output appears:
This program is distributed in the hope
... ## 7 lines ## ...
Artistic License for more details.
You should have received a copy of the
... ## 4 lines THIS PARAGRAPH CONTAINS THE LONG URL ## ...
glad to provide one.
You should also have received a copy of
... ## 8 lines ## ...
on the internet at
For those of you that choose to use the
... ## 40 lines ## ...
that.
##and tossed in at the end is the (split)long URL:
http://www.gnu.org/copyleft/hhhhhhhhhhh
hh/hhhhhhhhhhhhhhhhhh/gpl.html.
Very strange, all suggestions welcome