Can't locate DEV.pm in @INC

Discussion in 'Perl Misc' started by courtney.machi@gmail.com, Oct 31, 2005.

  1. Guest

    Hello,

    I am trying to link to a mysql database (DEV) through a perl script. I
    establish a link in a file called DEV.pm. I tried calling './require
    DEV.pm' and have also tried calling use DEV in the perl script and keep
    coming across the error Can't locate ./DEV.pm in @INC (@INC contains:
    etc etc. I think I need to somehow import DEV.pm into my @INC
    files...am I correct? If so how do I go about doing that?

    Thanks!
    Courtney
    , Oct 31, 2005
    #1
    1. Advertising

  2. wrote:
    > I am trying to link to a mysql database (DEV) through a perl script. I
    > establish a link in a file called DEV.pm. I tried calling './require
    > DEV.pm' and have also tried calling use DEV in the perl script and keep
    > coming across the error Can't locate ./DEV.pm in @INC (@INC contains:
    > etc etc. I think I need to somehow import DEV.pm into my @INC
    > files...am I correct?


    @INC is a variable, not a file.

    To manipulate @INC:

    perldoc lib

    Optionally you can

    require '/full/path/to/DEV.pm';

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Oct 31, 2005
    #2
    1. Advertising

  3. Paul Lalli Guest

    Re: Can't locate DEV.pm in @INC

    wrote:
    > I am trying to link to a mysql database (DEV) through a perl script. I
    > establish a link in a file called DEV.pm. I tried calling './require
    > DEV.pm' and have also tried calling use DEV in the perl script and keep
    > coming across the error Can't locate ./DEV.pm in @INC (@INC contains:
    > etc etc. I think I need to somehow import DEV.pm into my @INC
    > files...am I correct?


    Sort of, but you have it backwards. You need to expand Perl's
    definition of @INC to include the directory your module is in, rather
    than moving your module to a directory already included in @INC

    > If so how do I go about doing that?


    The same way suggested by the relevant FAQ on this topic:
    perldoc -q library
    Found in /opt/perl/lib/5.6.1/pod/perlfaq8.pod
    How do I keep my own module/library directory?

    See also: perldoc lib

    Paul Lalli
    Paul Lalli, Oct 31, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jennifer
    Replies:
    1
    Views:
    165
    Tad McClellan
    Jun 24, 2003
  2. Michael Evanchik

    Can't locate POE.pm in @INC

    Michael Evanchik, Sep 22, 2003, in forum: Perl Misc
    Replies:
    3
    Views:
    573
    Sam Holden
    Sep 24, 2003
  3. Gary Hartl

    Perl can't locate a .pm in @INC

    Gary Hartl, Nov 4, 2003, in forum: Perl Misc
    Replies:
    7
    Views:
    176
    Gary Hartl
    Nov 5, 2003
  4. Justin Wyllie
    Replies:
    5
    Views:
    239
    Peter Pan
    Jan 11, 2005
  5. Replies:
    3
    Views:
    1,627
Loading...

Share This Page