Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't locate Log/Agent.pm

Status
Not open for further replies.

frasernm

Programmer
Aug 7, 2001
25
GB
Hi,

I'm migrating a tool from a postgres back-end to a oracle back-end. The perl script uses our own error.pm. The postgres script runs perfectly, but the oracle script fails to run with the error:

Can't locate Log/Agent.pm in @INC ... at (eval 4) line 2.

We can connect to the oracle database using a script which doesn't use error.pm, and there are no changes to the error.pm file or to the postgres script (except for the connect line).

Thanks in advance,

Fraser
 
Take a look in "error.pm" and see if that module "use"es or "require"s a module called "Log::Agent" - if it does, then that's your answer - you need Log::Agent but you don't have it. I'm not familiar with Log::Agent.

HTH.
Hardy Merrill
Mission Critical Linux, Inc.
 
Hi,

No the error module doesn't have anything to do with Log::Agent. Another mysterious happening is the error function is being called to display the error despite there being no call in the oracle script.

Fraser
 
Fraser,

Could you post the line in the script that connects to the database please? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Hi,

The lines are (with username and password replaced):

my $connect = q{username/password@(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (COMMUNITY = MOON)
(PROTOCOL = TCP)
(HOST = localhost)
(PORT= 1521)))
(CONNECT_DATA = (SID = DEV)))};

$dbh =
DBI->connect('dbi:proxy:hostname=dbem01.uk;port=1678;dsn=dbi:Oracle:',
$connect,"")
or die "DBI->connect ............... not ok: ".$DBI::errstr ;

The above, with no use error works, but ideally it should be or error(new CGI,'Cannot connect');
 
Ok.... I thought you were maybe doing something with 'raise_error' in the connect call.....

That connect syntax is new to me by the way, I haven't acually seen anyone using the long form. Wouldn't
[tt]
$dbh = DBI->connect("dbi:Oracle:host=myhost.com;sid=ORCL", $user, $passwd)
[/tt]

do just as well?

Anyway, your script. That looks like a run-time error rather than a compile error (because of the [tt]eval()[/tt]). Have you traced your script through so that you know which statement is triggering the problem? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top