GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Text::Table::Paragraph(3) User Contributed Perl Documentation Text::Table::Paragraph(3)

Text::Table::Paragraph - Format table data as paragraphs of rows

This document describes version 0.002 of Text::Table::Paragraph (from Perl distribution Text-Table-Paragraph), released on 2016-01-01.

 use Text::Table::Paragraph;

 my $rows = [
     # header row
     ['name', 'summary', 'description'],
     # rows
     ['foo', 'bandung', 'a long description .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....'],
     ['bar', 'jakarta', 'another long description .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....'],
     ['baz', 'palangkaraya', 'yet another long description .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....'],
 ];
 print Text::Table::Paragraph::table(rows => $rows, header_row => 1);

This module provides a single function, "table", which formats a two-dimensional array of data as paragraphs. Each paragraph shows a row of data and columns are shown as "name: value" lines. Long values by default are wrapped and shown indented in the subsequent lines.

The example shown in the SYNOPSIS generates the following table:

 name: foo
 summary: bandung
 description: a long description .... .... .... .... .... .... .... .... ....
   .... .... .... .... .... .... .... .... ....

 name: bar
 summary: jakarta
 description: another long description .... .... .... .... .... .... .... ....
   .... .... .... .... .... .... ....

 name: baz
 summary: palangkaraya
 description: yet another long description .... .... .... .... .... .... ....
   .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
   ....

The "table" function understands these arguments, which are passed as a hash.
  • rows (aoaos)

    Takes an array reference which should contain one or more rows of data, where each row is an array reference.

  • header_row (bool)

    If given a true value, the first row in the data will be interpreted as a header row that contains column names. Otherwise, columns will be named: "column1", "column2", and so on.

  • wrap (bool, default 1)

    Whether to wrap long values.

  • wrap_width (int, default 72)

Set default for "wrap" option.

Set default for "wrap_width" option.

Please visit the project's homepage at <https://metacpan.org/release/Text-Table-Paragraph>.

Source repository is at <https://github.com/perlancar/perl-Text-Table-Paragraph>.

Please report any bugs or feature requests on the bugtracker website <https://rt.cpan.org/Public/Dist/Display.html?Name=Text-Table-Paragraph>

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

This module is currently basically Text::Table::Tiny 0.03 modified to output paragraphs instead of its original 2D text table format.

"Text::Table::*", Text::Table::Any

See also Bencher::Scenario::TextTableModules.

perlancar <perlancar@cpan.org>

This software is copyright (c) 2017 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2017-01-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.