Expect module not working in perl

I have installed the pending module in perl in the C: \ strawberry \ perl \ lib folder.

As a prerequisite, I installed the IO-Tty module first in the same location where perl is installed.

Now if I do

use Expect;

      

Throws an error

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.

      

Possible reasons:

  • Perl looks for the IO :: Pty and IO :: Tty module, which is called from Expect.pm. But when I installed the IO :: Tty module, it has 2 pm files named Pty.pm and Tty.pm

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

But perl is looking for the IO :: Tty module.

This is causing the problem. If so, how can I move forward

+2


source to share


2 answers


Waiting does not work under Windows.

At least that's my impression when looking at the CPAN Resters results. This table here: http://matrix.cpantesters.org/?dist=Expect;maxver=1 shows that there has never been a PASS for Expect under Windows.



Also, the Expect documentation says about a module that doesn't work with ActivePerl and recommends using cygwin instead: https://metacpan.org/module/RGIERSIG/Expect-1.21/Expect.pod#Can-I-use-this -module-with-ActivePerl-on-Windows . My guess is that Expect also doesn't work with StrawberryPerl.

+3


source


Have you installed these modules using cpan? - I would highly recommend installing modules via cpan only, so you get all the required dependencies.

If you did, try reinstalling it and watch for any errors.

I have tested installing via cpan and I need to compile the IO :: Tty package, so maybe you need to set up your build environment for any perl modules you would like to install.



If you only copied some precompiled files, make sure the files you were missing do exist and download the package again.

Edit: What I missed - The full path for your Pty.pm and Tty.pm should be something like "C: /strawberry/perl/lib/IO/Tty.pm"

+1


source







All Articles