Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Hi
What I've managed to observe on windows for ActiveState 561 is that @INC is derived based on the invoked location of the perl.exe. Well, actually, the perl5x.dll that is loaded by perl.exe. Basically, it looks up one dir (out of bin/) for lib/ and site/lib. If you move perl.exe and perl56.dll to some remote location that doesn't follow that structure:
bin/ lib/ site/lib
you won't get @INC set. Here's little test, where I copied perl.exe and perl56.dll to a bin/ directory under my "Documents and Settings"
C:\Documents and Settings\jim> C:\Progra~1\Perl\Perl561_638\bin\perl.e +xe -V Summary of my perl5 (revision 5 version 6 subversion 1) configuration: .... Built under MSWin32 Compiled at Apr 13 2004 19:24:21 @INC: C:/Program Files/Perl/Perl561_638/lib C:/Program Files/Perl/Perl561_638/site/lib . C:\Documents and Settings\jim>mkdir bin C:\Documents and Settings\jim>cp C:\Progra~1\Perl\Perl561_638\bin\perl +.exe bin\. C:\Documents and Settings\jim>cp C:\Progra~1\Perl\Perl561_638\bin\perl +56.dll bin\. C:\Documents and Settings\jim>set PATH=C:\Documents and Settings\jim\b +in;%PATH% C:\Documents and Settings\jim>perl.exe -V Can't locate Config.pm in @INC (@INC contains: .). BEGIN failed--compilation aborted. C:\Documents and Settings\jim>mkdir lib C:\Documents and Settings\jim>mkdir site\lib C:\Documents and Settings\jim>perl.exe -V Can't locate Config.pm in @INC (@INC contains: C:/Documents and Settin +gs/jim/lib C:/Documents and Settings/jim/site/lib .). BEGIN failed--compilation aborted.
Note that only when I have a lib/ and site/lib directory does the @INC get set correctly. Also, the main functionality is driven by the location of the perl56.dll, not the perl.exe file. perl.exe loads the .dll through the PATH environment variable, and it appears @INC is set with respect to the location of the .dll. So, if I remove the .dll from my local bin/ dir, the .dll is loaded from its default location, and @INC is set with respect to that location.
C:\Documents and Settings\jim>del bin\perl56.dll C:\Documents and Settings\jim>perl -V Summary of my perl5 (revision 5 version 6 subversion 1) ... ActivePerl Build 638 Built under MSWin32 Compiled at Apr 13 2004 19:24:21 @INC: C:/Program Files/Perl/Perl561_638/lib C:/Program Files/Perl/Perl561_638/site/lib .
HTH, Jim
(Update: fix cut and paste error)

In reply to Re: Win32 @INC behavior by jimbojones
in thread Win32 @INC behavior by richz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (4)
    As of 2014-07-26 12:33 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (176 votes), past polls