Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > PERL INCLUDE PATH automatically from Java Code

Reply
Thread Tools

PERL INCLUDE PATH automatically from Java Code

 
 
eser@libero.it
Guest
Posts: n/a
 
      09-07-2007
Hi all!
I have a big problem..

I developed an eclipse plugin who creates projects of "perl nature"
with a particular path: I must modify the perl build path but I don't
know what I have to do...In particular if I create the perl nature
project now as now, it is created with the original perl build path
and if I want to modify it I have to do right click on perl project
that is create starting the plugin, then "Properties" and then "Perl
Include Path", but I don't have to do this with my hands from the perl
project view. The plugin must be done in a way that the perl project
created must have the classpath already setted. If I don't modify this
path from the java code, a module (file.pm, is a mine particular
module who requires a particular path because call different USE in
his package) that is loaded at the same time of the perl project
returns errors because of some USE in file.pm .... who are not able to
find the right path

My java code now is:

IWorkspace work=ResourcesPlugin.getWorkspace();

IWorkspaceRoot workRoot=ResourcesPlugin.getWorkspace().getRoot();

IProject newProject=workRoot.getProject(name);

IProjectDescription
newProjectDescription=work.newProjectDescription(n ame);

String[] natureId=new String[1];

natureId[0]="org.epic.perleditor.perlnature"; //PERL NATURE

newProjectDescription.setNatureIds(natureId);

...............
//Here I think is the place where I have to modify the perl path of
the project the plugin is goig to create
.........................
newProject.create(newProjectDescription,null); //creazione progetto

Can you give me an idea or a little piece of source code to resolve
this problem?
I browse a lot in the web but I didn't find any idea to continue...

Is it possible to look throught perl path from java code?
Thanks very much! I need some helps ..!


Dani

 
Reply With Quote
 
 
 
 
Klaus
Guest
Posts: n/a
 
      09-07-2007
On Sep 7, 3:59 pm, e...@libero.it wrote:

[ snip ]

> ...creates projects of "perl nature"
> with a particular path: I must modify the perl build path but I don't
> know what I have to do...


[ snip ]

> a module (file.pm, is a mine particular
> module who requires a particular path because call different USE in
> his package) that is loaded at the same time of the perl project
> returns errors because of some USE in file.pm .... who are not able to
> find the right path
>
> My java code now is:


[ snip java ]

I don't know anything about Eclipse or Java, but as far as Perl is
concerned, you could read about "@INC" in "perldoc perlvar":

=======================
@INC
The array @INC contains the list of places that the do EXPR, require,
or use constructs look for their library files. It initially consists
of the arguments to any -I command-line switches, followed by the
default Perl library, probably /usr/local/lib/perl, followed by ``.'',
to represent the current directory. (``.'' will not be appended if
taint checks are enabled, either by -T or by -t.) If you need to
modify this at runtime, you should use the use lib pragma to get the
machine-dependent library properly loaded also:

use lib '/mypath/libdir/';
use SomeMod;

You can also insert hooks into the file inclusion system by putting
Perl code directly into @INC. Those hooks may be subroutine
references, array references or blessed objects. See require in the
perlfunc manpage for details.
=======================

--
Klaus

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl / cgi / include file a la #include me Perl Misc 10 03-26-2010 10:21 PM
/* #include <someyhing.h> */ => include it or do not include it?That is the question .... Andreas Bogenberger C Programming 3 02-22-2008 10:53 AM
ASP Error 0126 include file not found, when using ".." in include file path Eric ASP General 10 01-11-2007 07:38 AM
ASP Error 0126 include file not found, when using ".." in include file path Eric ASP General 0 01-09-2007 06:54 PM
Various path/path/files.asp all #include this 1 file \A_Michigan_User\ ASP General 1 07-10-2005 01:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57