It is located somewhere in the binary executable of your Perl interpreter, the exact offset of which tends to change from version to version. But I don't think you really want to know about that. I think what you really want to know is what directories does @INC point to? The following script will print it them out for you:

#! /usr/bin/perl -w use strict; foreach( @INC ) { print "$_\n"; }
If you want to include a module from code run anywhere, you have to arrange for it to be stored in one of these directories. Assuming one of the directories in @INC is c:\perl\lib\site_lib, if you wrote a module named Foo/Bar.pm, you would store it in c:\perl\lib\site_lib\Foo\Bar.pm.

Note that if you run the perl interpreter without doing anything special, the current directory (.) will be included in @INC. Should you run perl with taint checks enabled (via -T), then this will not be the case.

If you want to add your own directory to the @INC array, the preferred way of doing it is:

use libs 'c:/personal/code';

Use forward slashes rather than backslashes in Win32 path names. Perl understands both, but you'll avoid hairy escaping problems. use lib will push your added directory to the beginning of the list, which gives you a handy way of writing your own versions of modules to replace existing library code.

~
--
g r i n d e r

In reply to Re: @INC by grinder
in thread @INC by NodeReaper

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.