0

Hi folks,

Perl
===

Please advise how to add 'bold', 'italic', 'colour', etc. such features to the printout. Can HTML syntax work on perl? I tried seeming not applicable.

TIA

B.R.
satimis

2
Contributors
2
Replies
3
Views
12 Years
Discussion Span
Last Post by satimis
0

What exactly are you printing?

If you're generating HTML, you can have Perl generate HTML tags. But, if you're just outputting to the console, there may be methods of using ASCII escape codes to display the desired text effects, similar to how you can do when working with the bash shell.

0

Hi alc6379,

Tks for your advice.

If you're generating HTML, you can have Perl generate HTML tags. But, if you're just outputting to the console, there may be methods of using ASCII escape codes to display the desired text effects, similar to how you can do when working with the bash shell.

Major problem already solved with "use Term::ANSIColor qw(:constants);"

!/usr/bin/perl -w
use strict;
use warnings;
use Term::ANSIColor qw(:constants);

print "\n";
print BOLD WHITE ON_MAGENTA "REMARK :", RESET "\n";
print RED "OLINENO=Old Line No. NLINENO=New Line No.", RESET "\n";
print RED "OWORDNO=Old Word No. NWORDNO=New Word No.", RESET "\n\n";
...
...
format   STDOUT_TOP=
       ORGINAL         MISTAKE      OLINENO    NLINENO    OWORDNO    NWORDNO
#       ORGINAL         MISTAKE      LINENO    WORDNO
.
format   STDOUT_MID=
       @<<<<<<<<<<     @<<<<<<<<<<  @##       @##       @##       @##
#       @<<<<<<<<<<     @<<<<<<<<<<  @##       @##
       $org,           $mis,        $lno1,    $lno2,    $wno1,    $wno2.

.

....

But I still could not resolve printing the heading inside "format" with colour. I tried many places adding the codes without success.

Please advise. TIA

B.R.
satimis

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.