CuriousGeorge has asked for the wisdom of the Perl Monks concerning the following question:

I have a perl script which uses the perl DBI package. However, when I call this script from a PHP script I get the error "Can't locate object method "connect" via package "DBI" at ./dumb.pl line 12." in my apache error logs. I can run this perl script from the command line with no problems. Can anyone be of assistance?

Replies are listed 'Best First'.
Re: Calling Perl scripts from PHP.
by voyager (Friar) on Jul 17, 2001 at 22:04 UTC
    When run as a cgi script, it runs in a different directory and/or has different contents in @INC.

    Try a use lib "path/to/modules"; in your script and see if that does it.

Re: Calling Perl scripts from PHP.
by strredwolf (Chaplain) on Jul 18, 2001 at 09:12 UTC
    If it's a SQL server the Perl Script talks to, you may want to rewrite it in PHP -- which is rather trivial to do with PHP and it's native interface to SQL.

    Some things definetly need the port job.

    --
    $Stalag99{"URL"}="http://stalag99.keenspace.com";