エスケープシーケンスで色づけ
"\e[31m"で赤、"\e[0m"で元に戻す。
sub red(@*){ my(@msg)=@_; my $msg ="\e[31m@msg\e[0m"; $msg; } print "---------------------\n"; print red("foo", "bar","baz\n"); print "---------------------\n";
"\e[31m"で赤、"\e[0m"で元に戻す。
sub red(@*){ my(@msg)=@_; my $msg ="\e[31m@msg\e[0m"; $msg; } print "---------------------\n"; print red("foo", "bar","baz\n"); print "---------------------\n";