如何在Perl中输出文本表? [英] How do I output a text table in Perl?

查看:171
本文介绍了如何在Perl中输出文本表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 混淆矩阵$ b我想输出一个包含四个变量的表格, 
$ b H | P |
-----------------------
$ var1 | $ var2 | H
$ var3 | $ var4 | P

我遇到的问题是根据变量中的位数,格式变化并且各条线被抵消。我知道这是一个完全noobie的问题,但是我从来不必过分关注输出的格式,而这次我只是想要得到的一些小东西。任何帮助都会很好,谢谢。 Text :: Table / a>, Text :: SimpleTable :: AutoWidth


I want to output a table containing four variables, an example of the desired format is:

A confusion matrix

H        |    P     |
-----------------------
$var1    |   $var2  | H
$var3    |   $var4  | P

The problem I am having is that depending on the number of digits in the variables, the format changes and the various lines are offset. I know this is a complete noobie question, but I have never had to pay too much attention to the format of output before, its just one of those little things I want to get right this time. Any help at all would be great, thanks.

解决方案

Text::Table, Text::SimpleTable::AutoWidth

这篇关于如何在Perl中输出文本表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆