zoukankan      html  css  js  c++  java
  • Perl报错you may need to install the Win32::Console module(转)

    ActivePerl-5.26.3.XXXX.msi安装后,命令行执行cpan,会出现如下提示而无法继续。

    Can't locate Win32/Console.pm in @INC (you may need to install the Win32::Console module) (@INC contains: C:Perl64sitelib C:Perl64lib) at C:Perl64lib/ActivePerl/Config.pm line 400.

    解决办法,修改C:Perl64libActivePerlConfig.pm,大约在400行左右:

    # Prevent calling Win32::Console::DESTROY on a STDOUT handle
    #my $console;
    sub _warn {
    #    my($msg) = @_;
    #    unless (-t STDOUT) {
    #	print "
    $msg
    ";
    #	return;
    #    }
    #    require Win32::Console;
    #    unless ($console) {
    #	$console = Win32::Console->new(Win32::Console::STD_OUTPUT_HANDLE());
    #    }
    #    my($col,undef) = $console->Size;
    #    print "
    ";
    #    my $attr = $console->Attr;
    #    $console->Attr($Win32::Console::FG_RED | $Win32::Console::BG_WHITE);
    #    for (split(/
    /, "$msg")) {
    #	$_ .= " " while length() < $col-1;
    #	print "$_
    ";
    #    }
    #    $console->Attr($attr);
    #    print "
    ";
    }

    原文地址:http://euhat.com/wp/2020/01/03/you-may-need-to-install-the-win32console-module

  • 相关阅读:
    poj 3026 Borg Maze
    poj2828 Buy Tickets
    poj3264 Balanced Lineup
    高精度运算
    poj1035 Spell checker
    poj2318 TOYS 点积叉积理解
    求两直线交点的一般做法
    C语言I博客作业05
    C语言I博客作业04
    C语言I博客作业07
  • 原文地址:https://www.cnblogs.com/TonyJia/p/13861211.html
Copyright © 2011-2022 走看看