CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Error Can't locate /cgi-bin/static_data/dsn/dsn.pl in @INC

 



digioleg54
User

Apr 19, 2017, 1:51 PM

Post #1 of 3 (1860 views)
Error Can't locate /cgi-bin/static_data/dsn/dsn.pl in @INC Can't Post

I made a CGI script, put the line:

Code
use lib '/cgi-bin/static_data/dsn';

In the sub I have

Code
my $dsn_file = "/cgi-bin/static_data/dsn/dsn.pl"; 
require "$dsn_file";


But when I run the script, got an error


Code
Can't locate /cgi-bin/static_data/dsn/dsn.pl in @INC (@INC contains: /cgi-bin/static_data/dsn /export/applications/dte/perl-lib /vhosts/dw18637/lib/web/ /versions/perl-5.22.2/lib/perl5/site_perl/5.22.2/i686-linux /versions/perl-5.22.2/lib/perl5/site_perl/5.22.2 /versions/perl-5.22.2/lib/perl5/5.22.2/i686-linux /versions/perl-5.22.2/lib/perl5/5.22.2 /api .) at /vhosts/dw18637/lib/web/dtereport.pl line 122.


Could you please let me know how to escape such error?

Thanks a lot


FishMonger
Veteran / Moderator

Apr 19, 2017, 2:44 PM

Post #2 of 3 (1857 views)
Re: [digioleg54] Error Can't locate /cgi-bin/static_data/dsn/dsn.pl in @INC [In reply to] Can't Post

Don't specify the full path in $dsn_file specify the filename only.


Code
use lib '/cgi-bin/static_data/dsn'; 

my $dsn_file = 'dsn.pl';
require $dsn_file;



digioleg54
User

Apr 20, 2017, 7:28 AM

Post #3 of 3 (1849 views)
Re: [FishMonger] Error Can't locate /cgi-bin/static_data/dsn/dsn.pl in @INC [In reply to] Can't Post

I it/ The same problem. I just moved this file to my regular /lib/web directory, where I have all Perl packages and ours

Thanks

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives