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."

In reply to Re: Strange bug in Windows CMD when using perl programs by BrowserUk
in thread Strange bug in Windows CMD when using perl programs by dreel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.