Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Can't locate DEV.pm in @INC

Reply
Thread Tools

Can't locate DEV.pm in @INC

 
 
courtney.machi@gmail.com
Guest
Posts: n/a
 
      10-31-2005
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

 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      10-31-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) 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
 
Reply With Quote
 
 
 
 
Paul Lalli
Guest
Posts: n/a
 
      10-31-2005
(E-Mail Removed) 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
locate.exe Gopi MCSE 13 11-22-2005 02:16 PM
Trying to locate Firefox feature History Fan Firefox 5 05-30-2005 07:24 AM
Can't locate String::Approx.pm JVarsoke Perl 1 02-28-2004 07:17 AM
HTTP::Response error : "Can' t locate loadable object" Subodh Perl 0 01-07-2004 12:11 PM
how to locate & load 3rd party private assemblies at run time? Terry McKiernan ASP .Net 0 07-07-2003 04:24 AM



Advertisments