#!/usr/bin/perl use strict; use warnings; use Term::ANSIColor::Markup; my $text = qq{ word }; print Term::ANSIColor::Markup->colorize($text);