in reply to print a tabular report using perl
poj#!perl use strict; use List::MoreUtils 'each_array'; # test data my @FilePath = qw(hello1.c hello2.c hello2.c); my @Author = qw(saketh1 saketh2 saketh3); my @Revision = qw(r120 r12 r100); my $branch = 'Release1'; my $line = '|'.('='x113)."|\n"; my $fmt = "| %-35s | %-35s | %-35s |\n"; print ' 'x36,"Branch Name : $branch\n"; print $line; printf $fmt, ('FileName Changed','Author Revision','Number of file cha +nge'); print $line; my $result = each_array(@FilePath, @Author, @Revision); while ( my @f = $result->() ){ printf $fmt,@f; } print $line;
|
|---|