[PerlChina] 写了个模块Pretty::Table,请大家测试

rorot yang.liana at gmail.com
Wed May 7 19:53:07 PDT 2008


 :)顶一个先。

2008/5/7 陈学芹 <robbiecn at gmail.com>:

> 2008/5/7 Shan Leiguang <shanleiguang at gmail.com>:
> >
> >
> > 写了个模块Pretty::Table,可以打印比较漂亮的格式对齐的文本表格,可用于生成文本报表或日志文件,请大家测试,欢迎反馈你的意见和建议。
>
> 作者的创意很好,有意思,测试了一下,test.pl 没有任何输出,修改了一下有输出,
> 但有问题,在我的环境下
>
> 1. 运行包中自带的test.pl
>      $ perl test.pl
>  输出ok的断言,没有表格,很奇怪
> 1..7
> # Running under perl version 5.008008 for linux
> # Current time local: Wed May  7 22:28:51 2008
> # Current time GMT:   Wed May  7 14:28:51 2008
> # Using Test.pm version 1.25
> ok 1
> ok 2
> ok 3
> ok 4
> ok 5
> ok 6
> ok 7
>
> 2. 运行Pretty/Table.pm中的example,有输出两个表格
>   +-----------------------------------+
>  | Contacts                          |
>  +----+-------+--------+-----+-------+
>  | id | name  | sex    | age | email |
>   +----+-------+--------+-----+-------+
>  | 02 | jarry | male   | 26  |       |
>  +----+-------+--------+-----+-------+
>  | 02 | jarry | male   | 26  |       |
>  +----+-------+--------+-----+-------+
>  | 04 | marry | female | 26  |       |
>  +----+-------+--------+-----+-------+
>  | 01 | tommy | male   | 27  |       |
>  +----+-------+--------+-----+-------+
>  *-------*-------*-------*--------*-------*
>  | id    | 02    | 02    | 04     | 01    |
>  *-------*-------*-------*--------*-------*
>  | name  | jarry | jarry | marry  | tommy |
>  *-------*-------*-------*--------*-------*
>  | sex   | male  | male  | female | male  |
>  *-------*-------*-------*--------*-------*
>  | age   | 26    | 26    | 26     | 27    |
>  *-------*-------*-------*--------*-------*
>  | email |       |       |        |       |
>  *-------*-------*-------*--------*-------*
>
>  一个横排,一个竖排,但有问题,明明表格数据是
>     my $dr = [
>        ['id','name','sex','age','email'], #this is a row
>        ['01','tommy','male',27],
>        ['02','jarry','male',26],
>        ['03','shanleiguang',26,'shanleiguang at gmail.com'],
>    ];
>
> shanleiguang这行却没有了,出现两行jarry,是不是
>     $pt->insert(['04','marry','female',26], 4);
> 这个插入接口有问题阿? 另外,
>  ['03','shanleiguang',26,'shanleiguang at gmail.com'],这个测试数据
> 有印刷错误,第3列因为性别,而不是年龄.:)
>
> 3.我把性别用中文"男"字替换时,排版就不整齐了.
>
> 作者的idea不错,谢谢分享:)
>
>
> --
> /*
> *@author: chen xueqin
> *@email: robbiecn at gmail.com
> *@see: http://robbie.bokee.com
> *@see: http://groups.google.com/group/fzlug
> *@love: freedom,tux,open source
> */
> _______________________________________________
> China-pm mailing list
> China-pm at pm.org
> http://mail.pm.org/mailman/listinfo/china-pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/china-pm/attachments/20080508/44250f04/attachment.html 


More information about the China-pm mailing list