2

Eclipse on a mac, was working fine adding new modules until I Installed Text::CSV_XS which Eclips doesn't recognise as added to @INC For instance

use strict;
use SOAP::Transport::HTTP;

SOAP::Transport::HTTP::CGI->dispatch_to('C2FService')->handle;

BEGIN {

    package C2FService;
    use vars qw(@ISA);
    @ISA = qw(Exporter SOAP::Server::Parameters);
    use SOAP::Lite;

    sub c2f {
        my $self     = shift;
        my $envelope = pop;
        my $temp     = $envelope->dataof("//c2f/temperature");
        return SOAP::Data->name(
            'convertedTemp' => ( ( ( 9 / 5 ) * ( $temp->value ) ) + 32 ) );
    }
}

use SOAP::Transport::HTTP; is marked as error if I comment it out use SOAP::Lite; is in turn marked as an error, not found etc the usual if a module is not installed. Both are installed with CPAN and

$ perl -c soap-test.pl 
post-code-check.pl syntax OK

Perl is fine CPAN tests are all pass, the code works, only EPIC lags behind.

$ pwd && ls 
/opt/local/lib/perl5/site_perl/5.12.4/SOAP
Client.pod      Lite            Server.pod
Constants.pm        Lite.pm         Test.pm
Data.pod        Packager.pm     Trace.pod
Deserializer.pod    SOM.pod         Transport
Fault.pod       Schema.pod      Transport.pod
Header.pod      Serializer.pod      Utils.pod

And if I have use errors in the start of my files the rest of the source is not error checked..

2 Answers 2

3

I managed to fix this by adding all the paths I found on my system to the project include path manually through (click in the source of your project) > Project > Properties Go to the root directory of your project and open the .includepath file and make sure there are no trailing spaces after the paths and the closing quotes:

<includepathentry path="/opt/local/lib/perl5/vendor_perl/5.12.4 " /> which some of my entries had even though I just copy pasted them in Eclipse's GUI from the terminal there's no way there could've been a trailing space.

After all of these of course clean projects from the same Project menu.

2
  • I'm having this same problem but I don't have a .includepath file on the root of my Perl project. Also I ignore where cpan installs modules so to add the path...
    – m0skit0
    Jun 21, 2012 at 9:36
  • 1
    You can create one by focusing in the project (click on a src file in the proj explorer) then from the menus Project > Properties > "Perl Include Path" when you change that it should make a file. BTW you may not see it, hidden, starts with .
    – Recct
    Jul 9, 2012 at 9:18
1

Just adding the step-by-step for including modules in Eclipse Perl EPIC (with a few extra notes):

  1. Right click your project > Properties > Perl Include Path

  2. Enter or browse for the path you want to include

    In case your folder or files have spaces, make sure to surround the include path with double quotes

  3. Pre-pend your path with ${project_loc}/ as mentioned here

    i.e. ${project_loc}"/path/to/some module" or "${project_loc}/path/to/some module"

  4. Click 'Add to List' > Ok.

  5. Restart Eclipse

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .