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: Re: [nasirjavaid] Can't find DBD/mysql.pm - cPanel : Edit Log



Zhris
Enthusiast

Jan 30, 2016, 9:20 AM


Views: 3366
Re: [nasirjavaid] Can't find DBD/mysql.pm - cPanel

I haven't used cpanel in a while, but you have taken the right approach. Could you expand on "doesn't get called", do you receive the same "Can't locate DBD/mysql.pm" error? The begin block is best placed immediately below the shebang line of every perl script. In fact a proper approach would be to use an @INC manipulating module such as lib, but this isn't important. Dump the @INC array and check that the paths generated exist, theres a possibility you will need to modify the begin block root path / b__dir to suit your directory structure. Check that DBD/mysql.pm exists down one of the generated paths, if not then ensure you install it via the perl modules portion of cpanel.


Code
/usr/bin/perl 

BEGIN
{
my $b__dir = (-d '/home/username/perl'?'/home/username/perl':( getpwuid($>) )[7].'/perl');
unshift @INC,$b__dir.'5/lib/perl5',$b__dir.'5/lib/perl5/x86_64-linux-thread-multi',map { $b__dir . $_ } @INC;
}

for ( @INC )
{
my $exists = -e $_ ? ' ' : ' not ';
print "'$_' does${exists}exist\n";
}


Chris


(This post was edited by Zhris on Jan 30, 2016, 9:30 AM)


Edit Log:
Post edited by Zhris (Enthusiast) on Jan 30, 2016, 9:20 AM
Post edited by Zhris (Enthusiast) on Jan 30, 2016, 9:21 AM
Post edited by Zhris (Enthusiast) on Jan 30, 2016, 9:23 AM
Post edited by Zhris (Enthusiast) on Jan 30, 2016, 9:25 AM
Post edited by Zhris (Enthusiast) on Jan 30, 2016, 9:25 AM
Post edited by Zhris (Enthusiast) on Jan 30, 2016, 9:28 AM
Post edited by Zhris (Enthusiast) on Jan 30, 2016, 9:29 AM
Post edited by Zhris (Enthusiast) on Jan 30, 2016, 9:30 AM


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

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