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

Re: [FWP] right-justified line wrapping



On Wed, Jun 07, 2000 at 05:47:30PM -0500, David L. Nicol wrote:
> Is there any trick to getting the spaces to even out?  I suppose
> my loop from yesterday would work, with an extra step thrown in to
> double spaces until the line is too long, and then remove random
> spaces until the line is exactly WIDTH wide, but how to do this
> within a single s///?

It shouldn't be hard to get the difference between the desired length and
the actual length, divide by the number of spaces in the line, and figure
out how many spaces need to be added to each existing space, including
portioning out the remainder.

Ronald

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