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