Error on remote file system module reference

mitenm wrote on Thu Jan 10 14:39:49 CET 2008:
Hello,

I have noticed that when I have situation as below it fails to compile code.

c:\A.pl -> AFS location m:\B.pm -> AFS location m:\somedir\C.pm 

A.pl will show error where it references B.pm and B.pm shows error where
it references C.pm.

A.pl will be able to open declaration of B.pm in spite of error marker but
B.pm will not be able to open C.pm.

A.pl include path configured to have B.pm shows fine.  But B.pm include
path is not inheriting A.pl include path.  I see that it is the cause of
this problem.

Please some one verify and guide.

Miten.
jploski wrote on Thu Jan 10 14:55:04 CET 2008:
What do the ->'s mean in your description? I don't have AFS, so I cannot
reproduce your exact set up, but I may be able to explain (perhaps AFS is
not relevant to your situation at all). You mention files "inheriting" include
path - this notion of "inheritance" appears strange to me. EPIC just invokes
perl -c -I/first/element/of/project/incpath -I/second/element/of/project/incpath
/path/to/some/file.pl for each file in the project.
mitenm wrote on Tue Jan 15 09:06:46 CET 2008:
Hello,

Earlier sybGetPrinc was in 
#use lib '/ms/dist/syb/dba/perl5/modules';

I moved it to /ms/user/m/mitenm/perllibs/syb/dba/perl5/modules for my testing.
 Even with it being in old location I can run test.pl fine.

By the way, sybGetPrinc is in package sybGetPrinc.

Now from remote_mymodule.pm I am able to code things and when executed they
give results as expected but when I highlight sybGetPrinc and do F3 it cannot
locate the file.  I can F3 from test.pl (first hop).  This is the problem
I am talking about.  Not execution but editing feature.

Also I did turn on enable debugging but I was unable to get include path
printed.  I saw perl debugger window with perl -d thread may be with a Server
and green arrow icon.  Where exactly can you see Include Path as you said
I could not get.

below is code on remote_mymodule:

package com::mymodules::remote_mymodule;


use vars qw(@ISA @EXPORT @EXPORT_OK);

use lib '//ms/user/m/mitenm/perllibs/syb/dba/perl5/modules';
use sybGetPrinc qw(sybGetPrinc $sybx);

require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw($rmymoduletest rmodule_myprint);
@EXPORT_OK = qw($rmymoduletest);

$rmymoduletest = "hello";

#use lib '/ms/dist/syb/dba/perl5/modules';
#use sybGetPrinc qw(sybGetPrinc);


sub rmodule_myprint {

    print "sybGetPric sybx=" . $sybx . "\n";
    print "sybGetPric HKP_DOJO=" . sybGetPrinc("HKP_DOJO") . "\n";
    return "hello world in rmodule_myprint\n";
    
}
return 1;
jploski wrote on Wed Jan 16 00:37:06 CET 2008:
You can see the include path in
- the Error Log view (you may have to open it and it might be missing altogether
depending on the version of Eclipse you installed)
- in the workspace/.metadata/.log file (always)

Since you now mention that execution works fine (after all?), and the problem
only occurs with F3 navigation, I don't think that the include path used
for running the script is relevant. The F3 feature consults the include
path of the enclosing project for the Perl file in which you press F3. If
this file does not belong to any of your own projects (as it seems to be
the case for your remote_mymodule), then it is a linked resource which exists
in a special project named epic_links. The include path of this special
project will be used for the search, but since epic_links does not have
a Perl project nature, it does not have an .includepath either. Accordingly,
an empty (= system default) include path will be used - certainly not the
include path of the project from which your "first hop" of the F3 navigation
originated. I think that you could put an .includepath file in the epic_links
project and it might work as expected then, but I'd consider it a hack.

mitenm wrote on Wed Jan 16 10:58:36 CET 2008:
Hello,

I see that inspsite of following include path the IDE has problem in doing
F3 open declaration on second remote file system hop. test.pl can well open
sybGetPrinc but if same I try from test.pl -> remote_mymodule.pm -> sybGetPrinc
it cannot do F3.  It runs fine though.

!ENTRY org.epic.debug 1 0 2008-01-15 13:22:13.221
!MESSAGE Starting Perl debugger:
Command line:
perl
-I//ms/user/m/mitenm/perllibs
-I//ms/user/m/mitenm/perllibs/com/test
-I//ms/user/m/mitenm/perllibs/syb/dba/perl5/modules
-IC:/Documents and Settings/mitenm/MSDE/eclipseide/3.3prod/workspaces/default/.metadata/.plugins/org.epic.debug
-IC:/Documents and Settings/mitenm/MSDE/eclipseide/3.3prod/workspaces/default/mytest
-Mautoflush_epic
C:/Documents and Settings/mitenm/MSDE/eclipseide/3.3prod/workspaces/default/mytest/test.pl
Working directory: C:\Documents and Settings\mitenm\MSDE\eclipseide\3.3prod\workspaces\default\mytest
mitenm wrote on Fri Jan 11 07:50:43 CET 2008:
Hello Jan,

Please read through entire email as I am referring to modules not explained
yet.  The code for most modules it also listed below.

From previous post you asked about what -> is.
A.pl -> B.pm means 
A.pl is using B.pm with statement
use B;

Also inheriting include path I mean that if I do use lib in A.pm and then
when I am using B.pm then B.pm should be able to see all use lib that A.pm
have done.  Atleast all include path items in xml should be visible.


We have AFS client on XP installed and we can map m: to \\ms\all.  I am
able to run test.pl (code at bottom) fine with just one hop to refer to
remote file system modules.  test.pl when it uses remote_mymodule.pm it
works fine as along as remote_mymodule.pm does not refer to sybGetPrinc.

I am sharing some code below.

My project structure is as below.

eclipse project dir: 
C:\Documents and Settings\mitenm\MSDE\eclipseide\3.3prod\workspaces\default\mytest

with files under project space:
C:\Documents and Settings\mitenm\MSDE\eclipseide\3.3prod\workspaces\default\mytest\com\mymodules\mymodule.pm
C:\Documents and Settings\mitenm\MSDE\eclipseide\3.3prod\workspaces\default\mytest\com\test\myrequired.pm
C:\Documents and Settings\mitenm\MSDE\eclipseide\3.3prod\workspaces\default\mytest\test.pl

Next from test.pl and other modules (sybGetPrinc) I refer to remote file
system modules which are on project include path.



  
  
  


perllibs has structure similar to project as below.

/ms/user/m/mitenm/perllibs
pisdb45>find .
.
./com
./com/test
./com/test/remote_myrequired.pl
./com/mymodules
./com/mymodules/remote_mymodule.pm

You can see that using above include path items I should be able to use
remote_mymodule.pm and remote_myrequired.pl.

I can well refer to these first hop of remote modules.  So far good.  

Next hop has problem and I can see that include path does not show above
path items on hovering over error in IDE.

Now if I refer to sybGetPrinc in remote_mymodule.pm using use statement
it gives syntax error.  I cannot open its declaration using F3 from remote_mymodule.pm.

Same sybGetPrinc I can open fine from within test.pl (first hop).  

So I observe that test.pl is on local system within project space.  It can
open declaration of sybGetPrinc using include path item.  test.pl can also
F3 remote_mymodule.pm fine.  But further there is problem.

Let me know if I can further clarify.


test.pl
=======
#!/usr/bin/perl -w


use lib 'c:/Documents and Settings/mitenm/MSDE/eclipseide/3.3prod/workspaces/default/mytest/com/test';

use lib '/ms/user/m/mitenm/perllibs/com/test';#remote hop dirs
use lib '/ms/user/m/mitenm/perllibs';#remote hop dirs

use lib '/ms/dist/syb/dba/perl5/modules';
use sybGetPrinc qw(sybGetPrinc);#first remote hop


 
use com::mymodules::mymodule; #qw($mymoduletest module_myprint);
use com::mymodules::remote_mymodule; #qw($rmymoduletest rmodule_myprint);

require "myrequired.pl";
require "remote_myrequired.pl";

print "pl scalar " . $test . "\n";
print "pl method " . myprint() . "\n";
print "pm scalar " . $mymoduletest . "\n";
print "pm method " . module_myprint() . "\n";

print "rpl scalar " . $rtest . "\n";
print "rpl method " . rmyprint() . "\n";
print "rpm scalar " . $rmymoduletest . "\n";
print "rpm method " . rmodule_myprint() . "\n";


remote_mymodule.pm
==================
package com::mymodules::remote_mymodule;

require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw($rmymoduletest rmodule_myprint);
@EXPORT_OK = qw($rmymoduletest);

$rmymoduletest = "hello";

#second remote hop error <<<<<<<================
use lib '/ms/dist/syb/dba/perl5/modules';
use sybGetPrinc qw(sybGetPrinc);


sub rmodule_myprint {
    return "hello world in rmodule_myprint\n";
    
}
return 1;



mymodule.pm
===========
package com::mymodules::mymodule;



require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw($mymoduletest module_myprint);
@EXPORT_OK = qw($mymoduletest);

$mymoduletest = "hello";

sub module_myprint {
    return "hello world in module_myprint\n";
    
}
return 1;


code ends here.

Thanks for reading through and being patient.

-Miten.
jploski wrote on Mon Jan 14 20:11:32 CET 2008:
In what file is the 'sybGetPrinc' package defined?
jploski wrote on Mon Jan 14 20:16:03 CET 2008:
Another idea: Go to Preferences/Perl EPIC and put a tick next to "Enable
debugger console (experimental)" there. After that, start test.pl in debug
mode and make it fail as you described. A message will be inserted in the
view "Error Log" (which really just shows the contents of the file workspace/.metadata/.log)
will contain the complete command line which is used by EPIC to run the
Perl interpreter. Post this info here. (You can disable the debugger console
in Preferences afterwards.)

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