my $msg = "Hello world"; my $color = 101; # Red background print "\e[${color}m $msg \e[m\n"; # Embed $color in escape sequence