[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] new real world golf hole: line wrapping (proposed andsolved)



I always thought so; and then again, Tom Christiansen wrote a formatter and
posted it to Usenet several times -- that I know of.

Here is a script taken out of the Cookbook Chapter One examples:

#!/usr/bin/perl -w
# wrapdemo - show how Text::Wrap works

@input = ("Folding and splicing is the work of an editor,",
          "not a mere collection of silicon",
          "and",
          "mobile electrons!");

use Text::Wrap qw($columns &wrap);

$columns = 20;
print "0123456789" x 2, "\n";
print wrap("    ", "  ", @input), "\n";



(PS - While I've enjoyed many of the 'reduce this problem to the smallest
solution -- I've NEVER been interested in golf.  :)

HTH;  -Sneex-  :]
- FCCJ * 501 W State St * Jacksonville, Fl 32202 * 904/632-3089 -


> : ) on a HP deskjet.  After discovering that none of the tools that came with
> : windows 98 or Caldera OpenLinux (which has a very nice automounter) could
> : perform a word wrap service and save the text file as a wrapped text file,
> 
> Caldera OpenLinux doesn't come with fmt?
> 
> Greg


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe