Can't locate DEV.pm in @INC

C

courtney.machi

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
 
G

Gunnar Hjalmarsson

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';
 
P

Paul Lalli

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top