Run Ignores Include Path

lloy0076 wrote on Sat Mar 10 11:48:01 CET 2007:
My include path includes:

 ${project_loc}

I didn't do that - I used add to list, navigated the file system and pointed
at the project's location on disk. I presume that the plugin realised that
I was actually pointing to the same location as an Eclipse variable and
displayed it as that.

I have this on:

project_loc

 - server.pl
 - Server.pm

Let's say I run this:

#!/usr/bin/perl

use strict;
use warnings;

#use Server;

print join ("\n", @INC) . "\n";

This will print out this:

/usr/perl5/5.8.4/lib/i86pc-solaris-64int
/usr/perl5/5.8.4/lib
/usr/perl5/site_perl/5.8.4/i86pc-solaris-64int
/usr/perl5/site_perl/5.8.4
/usr/perl5/site_perl
/usr/perl5/vendor_perl/5.8.4/i86pc-solaris-64int
/usr/perl5/vendor_perl/5.8.4
/usr/perl5/vendor_perl
.

Note that ${project_loc} is not printed out.

If I do this:
#!/usr/bin/perl

use strict;
use warnings;

use Server;

print join ("\n", @INC) . "\n";

The syntax highlighter will NOT complain, however if I run that I get this:

Can't locate Server.pm in @INC (@INC contains: /usr/perl5/5.8.4/lib/i86pc-solaris-64int
/usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4/i86pc-solaris-64int /usr/perl5/site_perl/5.8.4
/usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/i86pc-solaris-64int /usr/perl5/vendor_perl/5.8.4
/usr/perl5/vendor_perl .) at /home/lloy0076/work/programming/eclipse/Server/server.pl
line 6.
BEGIN failed--compilation aborted at /home/lloy0076/work/programming/eclipse/Server/server.pl
line 6.

NOTE: If I navigate on the command line to ${project_loc} and manually run
"perl server.pl" it won't complain.

Anyone know what's up here?

DSL
jploski wrote on Sat Mar 10 13:51:12 CET 2007:
Your description is confusing. Please mention:
- where the workspace is located in the file system (absolute path)
- what absolute path project_loc points to
- where each of your files is located in the file system (absolute path)
- to which file the quoted source code belongs
- which working directory do you run in whatever you run

Alternatively, I suggest the following organization for your code

/home/lloy0076/workspace/project/bin/server.pl   (contains use Server;)
/home/lloy0076/workspace/project/lib/Server.pm   (contains package Server;)

Given that, add 'lib' (the relative path) to the @INC in project properties.
Everything (including setting breakpoints in Server.pm) should work fine
then.

Note: The above is an archived snapshot of a forum thread. Use the original thread at sf.net to post comments.