use if $^O eq "WINMS32", Term::ANSIColor qw(:constants); produces: syntax error at C:\temp\gethost3.pl line 4, near "Term::ANSIColor qw(:constants)" Execution of C:\temp\gethost3.pl aborted due to compilation errors. Windows #!/usr/bin/perl use Win32::Console::ANSI; use Term::ANSIColor qw(:constants); $SUCCESS=GREEN; $NORMAL=RESET; $RESULT="THIS IS THE RESULT LINE"; $line=sprintf("%s%s%s\n",$SUCCESS.$RESULT.$NORMAL); print $line; Unix !/usr/bin/perl $FAILURE=`echo -en "\\033[1;31m"`; $SUCCESS=`echo -en "\\033[1;32m"`; $NORMAL=`echo -en "\\033[0;39m"`; $RESULT="Test Line Test Line Test Line Test Line Test Line Test Line Test Line Test Line "; $line=sprintf("%s%s%s\n",$SUCCESS.$RESULT.$NORMAL); print $line; $line=sprintf("%s%s%s\n",$FAILURE.$RESULT.$NORMAL); print $line;