32.43. Text::Wrap
This prints:
The Text::Wrap module implements a simple paragraph formatter.
Its wrap function formats a single paragraph at a time by breaking
lines at word boundaries. The first argument is the prefix prepended
to the first line returned. The second argument is the prefix
string used for all lines save the first. All remaining arguments are
joined together using a newline as the separator and returned as
one reformatted paragraph string. You'll have to figure out your
terminal's width yourself, or at least specify what you want in
$Text::Wrap::columns. Although one could use the TIOCGWINSZioctl call to figure out the number of columns, it would be
easier for those not used to C programming to install the CPAN
module Term::ReadKey and use that module's GetTerminalSize
routine.
![]() Copyright © 2001 O'Reilly & Associates. All rights reserved. |
|