Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Eclipse and PERL

by RaduH (Scribe)
on Oct 22, 2007 at 23:22 UTC ( #646596=perlquestion: print w/ replies, xml ) Need Help??
RaduH has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

If this is not the right place for this question, I'd appreciate a pointer. I am using Eclipse and I have installed the PERL extension (or whatever it is called). I want to use a module that was not installed by default with Perl (Expect.pm, to be more precise) I have copied the pm file in the current directory (next to the Perl script) as well as in the Perl/lib folder. However, Eclipse shows a compilation error on the "use Expect" line (yes, I have the ; at the end :) ).

I use ActiveState Perl 5.8.8 on a Win2000 box. My Eclipse is 3.3.0.

Thanks for any advice you may have for me,
RH

Comment on Eclipse and PERL
Re: Eclipse and PERL
by Joost (Canon) on Oct 22, 2007 at 23:41 UTC
      Well, from the CPAN pages: "Copy the module into your Perl's lib directory. That'll be one of the directories you see when you type perl -e "print qq(@INC)". "
      I already have the .pm file (the zip from CPAN does contain Expect.pm) Even more, it does NOT have source code for me to compile to begin with.
      Thanks,
      RH.
        Well, Expect seems to be perl only (no C or other code) so it may work by copying, but other stuff can go wrong that the normal installation process does or checks for; for instance, Expect requires IO::Tty and IO::Pty, so it probably won't work unless you've got those modules installed too (including their requirements recursively)

        If they're availabe, you should probably use the ppm packages for active state perl. Otherwise, for pure perl modules, you may be able to just install nmake and use that to install from CPAN directly using the CPAN shell.

Re: Eclipse and Perl
by chromatic (Archbishop) on Oct 23, 2007 at 00:15 UTC

    I second the recommendation to use PPM, but if you're determined to do things this way, you'll have to post the exact error message that Eclipse gives. Without that, all we can do is guess at what's wrong.

      Eclipse has that nice way of marking the line with a compilation error with a red dot on the side. The error message is "Compilation failed in require A fatal error (trappable) Perl could not compile a file specified in a C<require> statement. Perl uses this generic message when none of the errors that it encountered were severe enough to halt compilation immediately." This is on the line where I include Expect (use Expect;) Given the dependencies I learned about from the replies here, it is possible that the Expect module is found but some dependencies are missing and therefore the error is inside the module where other modules (that are missing) are being included and Eclipse can only flag the "use Expect;" line for obvious reasons (if this is indeed the case).
Re: Eclipse and PERL
by syphilis (Canon) on Oct 23, 2007 at 01:51 UTC
    Hi RaduH,

    Unfortunately, Expect won't work on Windows. (At least I don't know of anyone having managed to get it to work on Windows.)

    Expect may work on Cygwin ... if you like to install Cygwin on your Win2000 box. But you would then also need to follow the correct module installation procedure as others have indicated. See perldoc perlmodinstall.

    Cheers,
    Rob
      I am using the Windows box only for UI purposes. The files are on a drive mapped off of a Unix machine and I run the software on that Unix box. I use Eclipse only as IDE and have a separate ssh session to that Unix machine where I execute my scripts at the command line.
      Thanks for all your advices. It seems to be a bit more complicated than I thought. I'll investigate your suggestions.
      RH
Re: Eclipse and PERL
by idsfa (Vicar) on Oct 23, 2007 at 15:45 UTC

    Either:

    1. use lib 'relative/path/to/module'; before the use Expect;
    2. - or -
    3. Right click on the Perl project. Select Properties. Change to the "Perl Include Path" panel in the pop-up. Should be obvious from there ...

    The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon
      Hi idsfa,
      I had tried your #2 before. I had added both the path to the Perl lib folder and to the current folder (bizarre as it may sound :) ) Didn't make a difference.
      I tried your #1 just now and there's no difference. This confirms one more time that the problem is not reaching the Expect module, but reaching other dependencies the Expect module is referring and I may have not installed on the windoz box I mentioned.
      I appreciate your advice. Like I said I really run the script on a Unix machine that seems to have everything installed and configured correctly (I have other questions related to using Expect now, but I still dig around by myself before asking for help).
      Thanks again,
      Radu
        the problem is not reaching the Expect module, but reaching other dependencies the Expect module is referring and I may have not installed on the windoz box

        Yes, that's the problem. And the gotcha is that those dependencies don't build on Windows :-)

        Cheers,
        Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://646596]
Approved by Thilosophy
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2014-08-30 23:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls