I have some very long strings that I want to print to the screen and read through individually. In order to make it easier to read, I want to highlight (e.g., underline, bold, color, etc.) a few keywords.
Is there an easy way to do this without splitting up each string around every keyword and inserting formatting commands?
I think I can do a global replace of my keywords with the formatted keyword like so:
$mystring =~ s/keyword/formatted keyword/g;
print "$mystring";
will this work, or will the print command interpret the formatting commands as plain text?
Also, is there a simple formatting command for bold or underline?