Used when one file is dependent on many files to make sure that the target is younger than all its sources. Allows for an easy test of the form:
if (fileOutOfDate($target, $source1,$source2,$source3))
as in 'make' to decide whether the target needs to be updated from its sources.
Returns the first out of date source file to make debugging easier, or undef if no files are out of date.
Name
Data::Table::Text - Write data in tabular text format
Synopsis
use Data::Table::Text;
say STDERR formatTable([
[".", "aa", "bb", "cc"],
[1, "A", "B", "C"],
[2, "AA", "BB", "CC"],
[3, "AAA", "BBB", "CCC"],
[4, 1, 22, 333]]);
# . aa bb cc
# 1 1 A B C
# 2 2 AA BB CC
# 3 3 AAA BBB CCC
# 4 4 1 22 333
say STDERR formatTable([
{ aa => "A", bb => "B", cc => "C" },
{ aa => "AA", bb => "BB", cc => "CC" },
{ aa => "AAA", bb => "BBB", cc => "CCC" },
{ aa => 1, bb => 22, cc => 333 }]);
# aa bb cc
# 1 A B C
# 2 AA BB CC
# 3 AAA BBB CCC
# 4 1 22 333
say STDERR formatTable({
"" => ["aa", "bb", "cc"],
"1" => ["A", "B", "C"],
"22" => ["AA", "BB", "CC"],
"333" => ["AAA", "BBB", "CCC"],
"4444" => [1, 22, 333]});
# aa bb cc
# 1 A B C
# 22 AA BB CC
# 333 AAA BBB CCC
# 4444 1 22 333
say STDERR formatTable({
a => { aa => "A", bb => "B", cc => "C" },
aa => { aa => "AA", bb => "BB", cc => "CC" },
aaa => { aa => "AAA", bb => "BBB", cc => "CCC" },
aaaa => { aa => 1, bb => 22, cc => 333 }});
# aa bb cc
# a A B C
# aa AA BB CC
# aaa AAA BBB CCC
# aaaa 1 22 333
say STDERR formatTable(["a", "bb", "ccc", 4444]);
# 0 a
# 1 bb
# 2 ccc
# 3 4444
say STDERR formatTable({ aa => "A", bb => "B", cc => "C" });
# aa A
# bb B
# cc C
Description
Prints an array or a hash or an array of arrays or an array of hashes or a hash of arrays or a hash of hashes in a tabular format that is easier to read than a raw data dump.
Installation
Standard Module::Build process for building and installing modules:
perl Build.PL
./Build
./Build test
./Build install
Author
philiprbrenan@gmail.com
http://www.appaapps.com
Copyright
Copyright (c) 2016 Philip R Brenan.
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.