Documentation Center

Procedure

Procedure for using the Perl debugger

About this task

Refer to the section of testExCat.pl code and follow the steps below.

Procedure

  1. Change the string "CustomGetDocCatTweak" to the name of your custom module. Note that the .pm Perl module extension is not included in the string.
  2. If you are passing custom arguments, edit accordingly. For example change the line:
    my $CustomArgs = "$g_prog|$CustomModule|$OptionalCkOutDir|MyArg1|MyArg2|";
    to:
    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.

  3. To start the debugger for your script, from the command line, enter:
    perl -d testExCat.pl
  4. 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.