use Text::Wrap; $Text::Wrap::columns = 20; # default is 76 $pre1 = "\t"; # prepend this to first line of paragraph $pre2 = ""; # prepend this to subsequent lines print wrap($pre1, $pre2, "Hello, world, it's a nice day, isn't it?");
This module is a simple paragraph formatter that wraps text into a paragraph
and indents each line. The single exported function, wrap()
, takes three
arguments: a string to prepend to the first output line; a string to
prepend to each subsequent output line; and the text to be wrapped.
$columns
is exported on request.