I've run few debug sessions when made few changes in PM file.
Now, somehow, each time I launch as run, as debug session, old and irrelevant (containing error) PM's version has been loaded from some hidden folder under epic_link. No Clean, nor rebuild helps.
Note, the PM's step-by-step debugging caused to another Perl modules (not in the project, but under site/lib) opening, which supposed to be opened in epic_link, but I do not expect my PM opening in epic_link also, moreover irrelevant file version.
What could be a reason and how can I get rid from that file version?
Your @INC path is the issue - the pseudoproject epic_links is a way for EPIC to access module files that are not located under your workspace folder, but somewhere else on your system (but nevertheless they're used by your executing code). So in other words it is finding some system-wide modules when you think it should be finding some other (?) ones.
Edit Perl Include Path under project's Properties (right-click on project) and enter there (project-relative) paths to whichever subfolders are the root through which your modules may be found so that they are picked up in preference to the system-wide ones.
thanks for the answer.
1. I removed the module from the project
2. added perl/lib/[pm], perl/site/lib/[pm] to Included paths
3. added the module to the project (note, it was updated by wrong one from epic_link)
4. fixed the error
5. ran debug
the same wrong code has been loaded - line number in error message is irrelevant, since the wrong line was deleted. So looks like the origin still exists. May be additional cleaning is needed?
What module from which project and what do you mean by "removed"? Do you have perl/lib and perl/site/lib under your project directory? what is your project structure? What output do you get when you "use Data::Dumper; print Dumper(\@INC);" from within your debugged script - is it the set of directories through which the module in question can and should be found?
the problem is that my PM has been replaced by its irrelevant copy from
epic_link/[digits row] despite my PM is part of the project.
where myVM is project name, mg_works is workspace
I added these pathes to Included before:
What is the absolute path of the module that you think should be opened?
What is the absolute path of the modules that actually gets opened through the epic_links project?
(You can check both by right-clicking on the file and inspecting Properties.)
Meanwhile I created new project with these files, but the same issue persists - debugging opened PM from epic_links.
As it's displayed in Eclipse file properties:
Location: D:\Users\username\mg_works\VM\VM.pm - since the PM imported to the Project;
Actual (opened by debugger):
Location: C:\Perl\site\lib\AppUtil\VM.pm - original location
Note that it's safe to delete the "epic_links" project - it will be automatically recreated whenever a file that resides outside of your project/workspace needs to be opened.
Looks like I begin to understand - there's at least a confusion between PM, which is loaded by "use" from site/lib and it's copy, added into the Project.
I.e. I cannot import the PM's copy, but a reference to it. Can I do it? Or it should be always used by debug thru the medium epic_links?
I'm confused by your changes (which comments refer to your old and new project setup and how these differ from each other), but the basic algorithm of how .pm files are located is really simple:
The (project-relative) or absolute paths that you enter under Project Include Path in project properties are passed to the Perl interpreter using -I options and thus prepended to the runtime @INC for any script you run from that project (@INC also contains some system-wide paths compiled into Perl interpreter and maybe also some taken from the environment variable PERL5LIB if it is set). If you "use Something::Foo" in your code, then each directory in @INC will be checked to see if Something/Foo.pm exists in that directory. If yes and if the directory happens to be within your project, that file will be opened. If yes and if the directory happens to be outside of the project/workspace, then epic_links will be used to open the found file.
I think you should start with a HelloWorld project and go from there.
I just did not take to account that Project in Eclipse contains actual copies of the files, therefore had used 2 copies of the PM as in site/lib, as in the Project's directory. Since site/lib copy is not the Project's part, but loaded by "use", there was a confusion in the file updating and epic_link engaging. Now all works fine since I put the PM module in the separate directory, added it to the Project and into @INC.
Thank you very much for the help.
Note, step-by-step debugging opens the PM from epic_link, as it is not part of the project, but it is.
Log in to post a comment.