10 return "\e[1m0\e[0m" if $port == 0;
12 my $c = ( $port % 6 ) + 31;
13 return "\e[${c}m$port\e[0m";
16 $SIG{__WARN__} = sub {
18 my $msg = join('', @_);
19 if ( $msg =~ s{ line (\d+)\.}{ +$1} ) {
20 $msg =~ s{^(.+)( at .+)}{\e[31m$1\e[0m$2} if $msg !~ m{^#};
22 $msg =~ s{\[(\d+)\]}{ '[' . port2color($1) . ']' }eg;
23 $msg =~ s{\|}{\e[34m\|\e[0m}g; # blue bars
24 $msg =~ s{"}{\e[33m"\e[0m}g; # dark quotes
25 print STDERR $msg unless $msg =~ m{^#} && ! $ENV{DEBUG};