in reply to Re^2: Exporter problem
in thread Exporter problem

Hello Monks,
now I would like to put my toConfig.pm
in a directory called LIB;
so I have update my scripts:
use FindBin; use lib qw($FindBin::Bin LIB);
In Linux it works fine, but in Windows I have:
Can't locate toConfig.pm in @INC (@INC contains: $FindBin::Bin LIB C:/ +Perl/site/ lib C:/Perl/lib .) at C:\Documents and Settings\myFile. pl line 9.
Why?
Thank you...

Replies are listed 'Best First'.
Re^4: Exporter problem
by almut (Canon) on Jun 03, 2010 at 20:17 UTC

    qw($FindBin::Bin LIB) doesn't interpolate.  It's equivalent to ('$FindBin::Bin', 'LIB'), which means you specified the literal string '$FindBin::Bin' instead of the value of the variable.

    You probably meant

    use lib "$FindBin::Bin/LIB";

    presuming the LIB directory is a subdirectory of $FindBin::Bin (i.e. the directory from where script was invoked).

    See also Quote and Quote-like Operators.

Re^5: Exporter problem
by saintex (Scribe) on Jun 04, 2010 at 06:18 UTC
    Hello, I understand your suggestion,
    but what I like to do is to add two or more path in @INC:
    - the first is the directory of the script;
    - the second one is another directory inside the script.
    So, something like this:
    use lib ($FindBin::Bin,"$FindBin::Bin/LIB");
    Is it right?
    Thank you
      Is it right?

      Yes :)

        thank you!
Re^3: Exporter problem
by saintex (Scribe) on Jun 04, 2010 at 20:21 UTC
    Hello Monks,
    now I have another little problem...

    Now my script is locate in directory LIB
    and I have to use my toConfig package locate in parent directory.
    So I have:

    - toConfig.pm
    ------------- LIB
    ----------------- myFile.pl

    myFile.pl use toConfig, that is in the parent directory.
    I can I do that?

    I tried with:
    use FindBin; use lib "$FindBin::Bin/../";

    But it doesn't works.