Procedure
Procedure for using the Perl debugger
About this task
Procedure
- Change the string
"CustomGetDocCatTweak"to the name of your custom module. Note that the .pm Perl module extension is not included in the string. - If you are passing custom arguments, edit accordingly. For example change the line:
to:my $CustomArgs = "$g_prog|$CustomModule|$OptionalCkOutDir|MyArg1|MyArg2|";my $CustomArgs = "$g_prog|$CustomModule|$OptionalCkOutDir|-user=$user|group=$grp|";The Return object, $ReturnO, is passed to the subroutine PcmGetDocCat::export( ) to retrieve the return status and the pathname of the exported data from the adapter
Outside of these test scripts, do not be concerned with the return object, $ReturnO. The API methods PCMcommand::GetDocPerl and PutDocPerl create a return object and passes it to the perl entry subroutine in the specified adapter. The API releases the return object after the call to the Perl module completes. Two members of the return object, Status and ErrorMessage are used by the API to generate exceptions that can be handled in the calling code.
ErrorMessage contains the exception errors generated in the adapter modules with die. The third return object data member is Pathname. The value in Pathname is the export path to the document when GetDocPerl is called. It is not used by PutDocPerl. Pathname is returned by the API call to GetDocPerl when that method is invoked from Perl, VB or Java.
Calls to the API method GetDocPerl made in VB, Perl and Java, return the export path.
The call succeeded if no exception was thrown.
- To start the debugger for your script, from the command line, enter:
perl -d testExCat.pl - Using the debugger, step through the code to the subroutine
PcmGetDocCat::export( )then step into that subroutine.You are now in the adapter code where you can continue to step through the code, check variable values, and so on.Tip: The command line debugger prints its commands if you enter the letter h while in the debugger. Enter |h (the pipe character followed by the h character) so you can scroll through the text otherwise you are only able to view the last page.