If, as stated above, you want to implement bold text via HTML, use this:
You should also make sure that the contents of $x do not contain HTML control characters that could mess up the document. This piece of Perl code will make any string display verbatim in an HTML document instead of tags trying to be interpreted:
Code:
#!/usr/bin/env perl
use warnings;
use strict;
my %substitutions = (
'<' => '<',
'>' => '>',
'&' => '&',
);
while (read STDIN, $_, 1) {
if (exists $substitutions{$_}) {
print $substitutions{$_};
} else {
print;
}
}