期望模块在Perl中不起作用

尼特什

我已经在位置C:\ strawberry \ perl \ lib的perl中安装了Expect模块。

作为先决条件,我首先在安装perl的相同位置安装了IO-Tty模块。

现在,如果我在做

use Expect;

它抛出错误

Can't locate IO/Pty.pm in @INC (@INC contains: C:/strawberry/perl/site/lib C:/st
rawberry/perl/vendor/lib C:/strawberry/perl/lib .) at C:/strawberry/perl/lib/Exp
ect.pm line 22.
BEGIN failed--compilation aborted at C:/strawberry/perl/lib/Expect.pm line 22.
Compilation failed in require at croak.txt line 1.
BEGIN failed--compilation aborted at croak.txt line 1.

可能的原因是

  1. Perl正在寻找从Expect.pm调用的IO :: Pty和IO :: Tty模块。但是,当我安装了IO :: Tty模块时,它有两个名为Pty.pm和Tty.pm的pm文件。

    package Expect;
    
    use IO::Pty 0.97;       # We need make_slave_controlling_terminal()
    use IO::Tty;
    

但是perl正在寻找IO :: Tty模块。

这是引起问题的原因。如果是,那我该如何前进

斯拉文·雷齐奇

Expect在Windows下不起作用。

至少在看CPAN Resters结果时,这是我的印象。此处的表:http : //matrix.cpantesters.org/? dist=Expect;maxver=1表示在Windows下从来没有通过PASS for Expect。

另外,Expect文档讨论了该模块不能与ActivePerl一起使用的情况,建议改为使用cygwin:https : //metacpan.org/module/RGIERSIG/Expect-1.21/Expect.pod#Can-I-use-this-module-与Windows上的ActivePerl一起使用我认为Expect也不能与StrawberryPerl一起使用。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章