Wouldn't it make sense to eval {} the loading of the ANSI module and simply switch off colouring if the module is not available? You do it at one place, but not at the other (which makes me wonder why you require the module twice.
? Win32::Console::ANSI is only required once. The actual colouring interface used is provided by Term::ANSIColor.
I think i may have misled you earlier... Win32::Console::ANSI _is_ needed for colouring, but it _also_ must be used to ensure the correct codepage is used on output (regardless of whether you want to colour the ouput). Consider this:
c:\>perl -e "print '255 ', chr 255, qq(\n)"
255
c:\>perl -e "require Win32::console::ANSI; print '255 ', chr 255, qq(\
+n)"
255 ÿ
The latter of these is the correct one for my console.
You could argue that any script that does not require Win32::console::ANSI when printing to the console on Win32 is broken. I'd be interested to hear comments on this... especially if i'm wrong :-)