sub print_debug { use Term::ANSIColor qw(:constants); my ($text, @colors) = @_; print STDERR @colors, $text, RESET; } use Term::ANSIColor qw(:constants); print_debug ("foo", BLUE ON_WHITE);