[Chapter 7] 7.2.71 Text::Wrap - Wrap Text into a Paragraph
Author: Larry Wall, Tom Christiansen & Randal L. Schwartz
Date: 1999-07-02T02:04:42Z

#

| Chapter 7 The Standard Perl Library |

### 7.2.71 Text::Wrap - Wrap Text into a Paragraph

    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.

7.2.70 Text::Tabs - Expand and Unexpand Tabs |  | 7.2.72 Tie::Hash, Tie::StdHash - Base Class Definitions for Tied Hashes