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

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



In article <393E8A8C.AEBC2EC6@kasey.umkc.edu>,
"David L. Nicol" <david@kasey.umkc.edu> wrote:
> 	TOOLONG:
> 
> 	goto DONE if length <= 81;
> 
> 	s/^(.{1,80})\s//;
> 	print "$1\n";
> 
> 	goto TOOLONG;
> 
> 	DONE:

Am I missing something or is that:

while (length <= 81) {
  s/^(.{1,80})\s//;
  print "$1\n";
}

> perl -pe 's/(.{1,80})\s/$1\n/g'

I would make that (.{1,80}\S)\s+

> (discourage me to prevent future postings such as this)
> 
> -- 
>                           David Nicol 816.235.1187 nicold@umkc.edu
>                                             Visualize creamed corn

My kids just did a science experiment demonstrating that digestion begins
in the mouth.  It involved placing drops of saliva into a jar of creamed
corn and letting it sit to see what happens.
(Not intended as discouragement).

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