用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字
云代码 - perl代码库

perl 设置文本颜色

2012-10-14 作者: 神马举报

[perl]代码库

#-----------------------------
use Term::ANSIColor;

print color ( "red" ), "Danger, Will Robinson!\n", color ( "reset" );
print "This is just normal text.\n";
print colored ( "<BLINK>Do you hurt yet?</BLINK>", "blink" );
#-----------------------------
use Term::ANSIColor qw ( :constants );

print RED, "Danger, Will Robinson!\n", RESET;
#-----------------------------
# rhyme for the deadly coral snake
print color ( "red on_black" ),  "venom lack\n";
print color ( "red on_yellow" ), "kill that fellow\n";

print color ( "green on_cyan blink" ), "garish!\n";
print color ( "reset" );
#-----------------------------
print colored ( "venom lack\n", "red", "on_black" );
print colored ( "kill that fellow\n", "red", "on_yellow" );

print colored ( "garish!\n", "green", "on_cyan", "blink" );
#-----------------------------
use Term::ANSIColor qw ( :constants );

print BLACK, ON_WHITE, "black on white\n";
print WHITE, ON_BLACK, "white on black\n";
print GREEN, ON_CYAN, BLINK, "garish!\n";
print RESET;
#-----------------------------
END { print color ( "reset" ) }
#-----------------------------
$Term::ANSIColor::EACHLINE = $/;
print colored ( <<EOF, RED, ON_WHITE, BOLD, BLINK );
This way
each line
has its own
attribute set.
EOF
#-----------------------------


网友评论    (发表评论)


发表评论:

评论须知:

  • 1、评论每次加2分,每天上限为30;
  • 2、请文明用语,共同创建干净的技术交流环境;
  • 3、若被发现提交非法信息,评论将会被删除,并且给予扣分处理,严重者给予封号处理;
  • 4、请勿发布广告信息或其他无关评论,否则将会删除评论并扣分,严重者给予封号处理。


扫码下载

加载中,请稍后...

输入口令后可复制整站源码

加载中,请稍后...