Error on remote file system module reference

Help
Miten
2008-01-10
2013-05-20
  • Miten

    Miten - 2008-01-10

    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.

     
    • Jan Ploski

      Jan Ploski - 2008-01-10

      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.

       
      • Miten

        Miten - 2008-01-15

        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;

         
        • Jan Ploski

          Jan Ploski - 2008-01-15

          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.

           
          • Miten

            Miten - 2008-01-16

            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

             
    • Miten

      Miten - 2008-01-11

      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.

      <?xml version="1.0" encoding="UTF-8"?>
      <includepath>
        <includepathentry path="//ms/user/m/mitenm/perllibs" />
        <includepathentry path="//ms/dist/syb/dba/perl5/modules" />
        <includepathentry path="//ms/user/m/mitenm/perllibs/com/test" />
      </includepath>

      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.

       
    • Jan Ploski

      Jan Ploski - 2008-01-14

      In what file is the 'sybGetPrinc' package defined?

       
    • Jan Ploski

      Jan Ploski - 2008-01-14

      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.)

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks