I used
Text::Wrap to display a list of quotations stored in a database. Sample code looks like:
#! /usr/bin/perl -w
use strict;
use Text::Wrap;
my $quote = {
ID => 308 ,
Author => "Someone" ,
Quote => "123456789_" x 10
};
local $Text::Wrap::columns = 71; # from (70 + 1) where 70 is the max
+width
print "\nQuote Number " . $quote->{"ID"} . ":\n"
. wrap('', '', $quote->{"Quote"}) . "\n"
. " - " . $quote->{"Author"} . "\n\n";
The output is:
Quote Number 308:
123456789_123456789_123456789_123456789_123456789_123456789_123456789_
123456789_123456789_123456789_
- Someone