#!/usr/bin/perl use strict; use warnings; use feature 'say'; use Term::ANSIColor qw(colorvalid); use Term::ANSIScreen qw/:color :constants/; my $valid = colorvalid ('magenta'); say "Color string is ", $valid ? "valid" : "invalid"; say MAGENTA . "Magenta" . RESET; __END__ $ perl test.pl Color string is valid Magenta