How to Use the Perl Debugger
The critical section of testExCat.pl code, with some changes made for clarity, are described.
Make sure that you edit the test script setting $debug=1.
Edit the test script so that it invokes the adapter with the same arguments that your tool uses to call the Adapter.
my $EdPath;
eval {
my $OptionalCkOutDir = "";
$OptionalCkOutDir = 'D:\temp\autoproc';
my $CustomModule = "CustomGetDocCatTweak";
my $CustomArgs = "$g_prog|$CustomModule|$OptionalCkOutDir|myArg1|myArg2|";
my $lk_what = "none";
my $Adapter = "PcmGetDocCat";
my $debug=1;
if($debug) {
my $ReturnO = {
Status => 0,
ErrorMsg => "",
Pathname => ""
};
eval "use PcmGetDocCat";
my $path;
PcmGetDocCat::export($ReturnO,$CustomArgs,$lk_what,$g_PcmPath,$CmdO);
printf("Status=%s\nErrorMsg=%s\nPathname=%s\n",
$ReturnO->{Status},
$ReturnO->{ErrorMsg},
$ReturnO->{Pathname});
}
else {
eval {
$Adapter = PCMAPIMgr::get_perl_adapter_name($Adapter);
};
if($@) {
$exit_status = $err_no_adapter_server;
die $@;
}
$EdPath = $CmdO->GetDocPerl($g_PcmPath, $Adapter, $lk_what,$CustomArgs);
print "\n\nAfter GetDocPerl() Edit path is $EdPath\n";
}
};
if($@) {
PCMAPIMgr::FormatException("Caught exception from PcmGetDocCat.pm...\n",$@);
}
$ConnectionO->Disconnect();