您的位置:首页 > 其它

Term::ANSIColor 使用

2015-07-29 11:08 387 查看
推荐用法:

use Term::ANSIColor qw(:constants);
$Term::ANSIColor::AUTORESET = 1;
print BOLD BLUE "This text is in bold blue.\n";
print "This text is normal.\n";


运行一下脚本,就可以查看常用的颜色属性

use Term::ANSIColor qw(:constants);
$Term::ANSIColor::AUTORESET = 1;

my @colors = qw(CLEAR RESET BOLD DARK UNDERLINE UNDERSCORE BLINK REVERSE CONCEALED BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE ON_BLACK ON_RED ON_GREEN ON_YELLOW ON_BLUE ON_MAGENTA ON_CYAN ON_WHITE);
for my $color (@colors)
{
print eval $color, "$color";
print CLEAR, "\n";
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: