Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Require a script not found in @INC array

by pernod (Chaplain)
on Oct 07, 2004 at 08:35 UTC ( #397243=note: print w/replies, xml ) Need Help??

in reply to Require a script not found in @INC array

Try FindBin, it will create the absolute path to the directory where the script is run, and make it accessible in the variable $FindBin::Bin. Eg:

#! /usr/bin/perl use FindBin; use lib "$FindBin::Bin/../moduledir"; use My::Module; my $lister = My::Module->new(); . . .

Where moduledir is where I place my own code (big surprise :). This solved similar problems for me.

Hope this helps!

Mischief. Mayhem. Soap.

Replies are listed 'Best First'.
Re^2: Require a script not found in @INC array
by TJD (Initiate) on Oct 07, 2004 at 19:10 UTC
    I couldn't make this work, due to my own inadequacies as a Perl programmer, but it did get me to thinking. I went to the CGI Resource site and downloaded a freeware script called ServerCheck by Virtual Solutions. It showed me that the path I had been using was incorrect. Whether it was reported wrong, or I simply wrote it down wrong, is unknown, but as soon as I corrected it in Config.sys, the script worked. Thanks to everyone for their suggestions. You've saved my scalp once again. I was about to start pulling my hair out. :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://397243]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2021-05-13 10:46 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (134 votes). Check out past polls.