I think BrowserUk's guess is correct that you're using a cygwin built Perl / CPAN.pm on a terminal without support for ANSI escape sequences. In particular, I suspect it's Term::ReadLine (used under the hood) that's generating the escape sequences...

So, as a workaround (if you can't or don't want to use a version "made for Windows"), you could try to disable Term::ReadLine's ornaments feature. One way to do so would be to set the environment variable PERL_RL to " o=0" (note that the last char is zero, not a captital O, and that - according to the manpage - there's supposed to be a space at the beginning (for me it also works without...)).

I couldn't test it on Windows (because my Windows CPAN.pm doesn't have that problem...), but at least on my Linux box, the following succeeds in turning off any special rendering of the prompt, etc.:

PERL_RL=" o=0" perl -MCPAN -e shell

On Windows, I suppose that would be:

set PERL_RL= o=0 perl -MCPAN -e shell

If that doesn't help, you could also try turning off readline support entirely:

perl -MCPAN -e "$CPAN::Suppress_readline=1; shell"

But then, you'd of course no longer have readline support... ;)


In reply to Re: Strange bug in Windows CMD when using perl programs by almut
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.