Elijah has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to install a module (IO::PTY) which is a pre-req for the Expect.pm module which I am really after. However I try to run the Makefile.pm for the IO::PTY module and it errors giving me a message about the cc='cl' in the Config.pm file. The error says it cannot run the compiler cl and tells me to either edit the Config.pm file, create a symlink to the right location or just add it to my PATH environment.

However I have searched my drive looking for a cl compiler but none have been found. I could edit tehe Config.pm but to what?

Anyone ever had this happen and if so how can I fix it to install this module?

Replies are listed 'Best First'.
Re: Compiler cl?
by MADuran (Beadle) on Jan 29, 2004 at 17:30 UTC
    cl.exe is the Microsoft's Visual C ++ compiler if you are running a MS OS then you can download the .Net SDK that includes cl.exe

    Update: A re-reading your post I saw you want to use Expect.pm; IF you are running A MS OS I would search on Expect. I seem to remember reading of issues with MS OSs and Expect.pm (I have yet to figure out how to link super search results)

    MADuran
    Who Needs a spiffy sig

      Don't you just love their logic.

      The Microsoft® .NET Framework Software Development Kit (SDK) version 1.1 includes everything developers need to write, build, test, and deploy .NET Framework applications—documentation, samples, and command-line tools and compilers.

      Except

      You must install the .NET Framework Redistributable Package version 1.1 prior to installing the .NET Framework SDK.

      Consecutive sentences! And then you follow the link to look at the prerequisite to "everything you need" and...

      You must also be running Microsoft Internet Explorer 5.01 or later for all installations of the .NET Framework.

      Gah!


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      Timing (and a little luck) are everything!

      Though I am happy to see a version of cl is free (rather than having to buy VisualC++), a question must be raised as to whether you want dependancies on the .NET runtime and libraries. Kinda bad tradeoff for a free compiler if you ask me. I would like to see CPAN modules that could be built using MINGW on Windows, myself. That's free -- as in speech AND beer. Alas, they don't do it that way...always using cl.

      Assuming you are using an ActiveState version of Perl, it's usually better to see if there is a precompiled version by running "ppm". Unfortunately, ActiveState's ppm archive is only a small portion of CPAN (and many pieces are stale), and a lot of good modules still need to be hand-compiled.

      I have also heard Expect _is_ a no-go on Windows. I can't confirm it.

Re: Compiler cl?
by BUU (Prior) on Jan 29, 2004 at 22:33 UTC
    After doing some research a while ago attempting to get expect to install on windows, I learned that IO::PTY is basically not possible to install on default windows. You might have some vauge luck installing using cygwin, in which case your cc should equal cc (or gcc maybe, something).
      Damn! I was going to run it on Windows but I guess I can run it on Solaris. The thing is as of now I have a 500 line script that automates software upgrades on a piece of network gear I work with. I originally wrote this script using the telnet.pm to create and direct the session from a work station to the node. However I need a way (like expect) to issue a command and wait for a response before continueing. I accomplished this also by using the Telnet module due to the "waitfor" function in this module.

      This function seems a little buggy though which is why I wanted to rewrite it using the expect module. The waitfor command does not wait for some system responses before continueing therefore screwing up the entire process from there on out.

      Is there any way I can embedd true TCL/Expect in a perl script or maybe just write this section of the script in Expect and call it with the perl script when I get there?

      Can anyone think of any better ways to accomplish this?

        However I need a way (like expect) to issue a command and wait for a response before continueing. I accomplished this also by using the Telnet module due to the "waitfor" function in this module.
        If you don't background your system call (aka fork and exec), it should be synchronous -- waiting is automatic. I am unfamilar with your telnet module, but this is the way it should work, and the way the SSH version *does* work. So essentially you want to make sure your apps can run in non-interactive mode so they don't need input while running. Am I missing something?