use strict; use warnings; use Term::ANSIColor qw (color colored colorstrip :constants); my $str = "The purpose of the " . colored ("ts", "green") . " script is to ..."; print "$str\n"; format STDOUT = @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $str . write;