kosta has asked for the wisdom of the Perl Monks concerning the following question:

Hi folks, I dont know if this is even possible but... I am using aptana studio (I know I like vim the best too, but sometimes it is just convenient) for my perl editing now. Well I have my custom pm on the server. I have modules folder from my server mounted via ssh on my desktop. I added a symlink to one of @INC locations pointing to my desktop mount. Now I guess what Aptana could do is ... (when I write
use myModule;
=> Aptana would try to find myModule in INC to give me code completion. Therefore it would search the link that I created and search the remote pm files on server and find the proper module. .... That doesnt happen tho and it says couldnt locate module in INC How can I fix this ? :)

Replies are listed 'Best First'.
Re: add remote dir to @INC
by jpl (Monk) on May 25, 2011 at 16:42 UTC
    The devil is in the details of how you try to modify @INC.
    push(@INC, "/my/directory"); use MyModule;
    will not work.
    use lib "/my/directory"; use MyModule;
    should work.

    use and BEGIN are evaluated "at compile time", before any other code is executed. So, in the first example use MyModule; is evaluated before @INC has been modified. The second example works because both statements are evaluated at compile time.

    The PERL5LIB environment variable is, as was suggested, also useful. It, too, is processed at compile time.

      well that is what I did... I didnt even modify the PERL5LIB environment variable - I just created a symlink to my remote module folder in /System/Library/Perl/Extras/5.10.0. which already is in my INC, this didnt fix the issue however
        ok I got somewhere... maybe you can give me a hand here... when searching for modules "how deep" does perl descend? What happened to me that when I added to INC the whole remote modules folder but when I added site_perl folder (which was descended kinda deep in modules) it started working... Any way to make sure it does a complete recursive search?
Re: add remote dir to @INC
by fidesachates (Monk) on May 25, 2011 at 13:46 UTC
    What about trying the PERL5LIB environment variable?
Re: add remote dir to @INC
by locked_user sundialsvc4 (Abbot) on May 26, 2011 at 01:35 UTC

    Aptana (Eclipse...) has its own list ... one of the configuration entries ... that it uses for library lookups. I don’t honestly know whether it uses PERL5LIB or not ... and, at this hour of the evening with this fine glass of wine, I’m not findin’ out.   ;-)