How to Get Perl Colors in Cygwin
When coding in Perl, you can change the color of the text displayed using the ANSIColor rules. Perl operates, primarily, from a Unix-based shell. Cygwin is a Linux emulator developed for Windows and therefore does not have full compatibility with all functionality of Linux. ANSIColor, the Perl function, however is entirely compatible with Cygwin, so you will not encounter any errors. Perl colors can be used in various ways, though the basic implementation is with text printing.
Instructions
-
-
1
Open your Perl script in your chosen editor, such as vi or vim.
-
2
Scroll down to some text whose color you want to change.
-
-
3
Add, before the quoted printed text, a color name in capital letters. The basic available colors are black, red, green, yellow, blue, magenta, cyan and white. So, for example, a "Hello World" script in cyan would read:
print CYAN "Hello World.\n";
-
4
Save your script to run it with the new colors in Cygwin.
-
1