http://qs321.pair.com?node_id=753091


in reply to CPAN and readline on windows

Well, given that so much of CPAN.pm is still based on globals, you can do this:

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

Eventually, that should probably get moved to (yet another) configuration option. Please consider opening up an RT ticket about it if there isn't one already so we have it on the list of things to do.

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Replies are listed 'Best First'.
Re^2: CPAN and readline on windows
by BrowserUk (Patriarch) on Mar 25, 2009 at 16:55 UTC

    Yes. I've added:

    $Suppress_readline = 1;

    just after the use vars: where it is declared.

    The reason for asking if there was an official way of disabling it is because at the top of the shell() method, there is this line:

    $Suppress_readline = ! -t STDIN unless defined $Suppress_readline;

    which implies that $Suppress_readline could somehow be defined prior to the test on STDIN.

    I couldn't find the mechanism whereby that might occur--barring your way of setting it on the command line--, but had there been some existing mechanism (maybe an environment variable or similar), I would prefer that to modifying the script directly.


    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.
Re^2: CPAN and readline on windows
by BrowserUk (Patriarch) on Mar 25, 2009 at 18:05 UTC

        Okay, thanks.

        The reason I think that applying the disable in CPAN.BAT is good idea is that (I assume) people using *nix emulators (Cygwin Strawberry etc.) where they would need the ReadLine support, will probably not invoke cpan via a .BAT file?


        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.