in reply to Strange bug in Windows CMD when using perl programs

The weird character sequences are ansi escape sequences used to highlight or color the text on a *nix console. cmd.exe doesn't do ansi escape sequences so it displayes them literally.

Why CPAN.pm should be producing them I don't know. It didn't the last time I used it (a long while since). Maybe a new enhancement, and they got the test for OS wrong?

It could be 'fixed' by using Win32::Console::ANSI within cpan.pm itself. This converts the ANSI escape sequences into appropriate Console API calls effectively emulating a ANSI complient terminal. But I wouldn't advise a user to make that modification.

You need to work out why this happens for you, if nobody else is seeing the same problem?

The first thing you need to do is tell whomever is listening the details of your system: Which OS (exact version)? Which CPAN.pm (exact version)? Which Perl (exact version)? Perl source: AS, home build, other supplier? If home build, which compiler (and version(s))? Do you use cygwin? Was your perl built under cygwin?

Ie. a whole lot more than you have currently told us.

My guess is that you are using a cygwin built perl install, but trying to use it from a non-sygwin shell. And CPAN.pm has been built expecting a *nix-like environment and so is producing the escape sequences. But that's total speculation.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re: Strange bug in Windows CMD when using perl programs

Replies are listed 'Best First'.
Re^2: Strange bug in Windows CMD when using perl programs
by dreel (Sexton) on Jul 09, 2007 at 15:09 UTC
    Sorry for long time out. I'm newbie and i don't know how to setup notification by mail - there is so strange site intarface... My info: Win32 XP SP2 PRO, ActivePerl 5.8.820, GUI PPM, Perl installed by default ActiveState installer. CPAN - v 1.76_02
      My info: Win32 XP SP2 PRO, ActivePerl 5.8.820, GUI PPM, Perl installed by default ActiveState installer. CPAN - v 1.76_02

      Intriguing. Could you post the output from the command: set in a cmd.exe window?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.