Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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!

pernod
--
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2020-12-05 18:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (65 votes). Check out past polls.

    Notices?