< Previous | Next >

Using Perl

You can use the Rational® ClearQuest® API Perl package (CQPerlExt) by running cqperl.exe or ratlperl.exe.

About this task

All external applications written in Perl must begin with one of the following statements:
require CQPerlExt; 
or
use CQPerlExt; 

In version 2003.06.00 and later, you can use the Rational ClearQuest API with either cqperl.exe or ratlperl.exe for external applications. Using cqperl implicitly adds the correct include paths to CQPerlExt.pm (the Perl package that provides the Rational ClearQuest API). On the UNIX system and Linux cqperl cannot be used in the use or require statement in Perl scripts. If you use ratlperl on the UNIX system and Linux, you must set the correct path. For example, you can use the ratlperl binary, which is located under the /opt/rational/common directory, such as /opt/rational/common/linux_x86/bin.

You cannot use CQPerlExt.pm with standard Perl instead of ratlperl or cqperl. If you need to integrate with other modules, you must build them for the shipped version of ratlperl.

Notation conventions for Perl:
  • The prefix for objects that the Rational ClearQuest API can access through its CQPerlExt package is CQ. For example, CQEntity $CQPerlExt::CQ
  • The prefix for Perl enumerated constants is CQPerlExt::CQ. For example, $CQPerlExt::CQ_DB2 for the DB2® DatabaseVendor constant value.

The Rational ClearQuest enumerated constants are preloaded and available for use in field hooks and record and global scripts. However, to use the constants in an external application, you must add the constant definitions to your program before you can use them in the program, or the values will not be set.

Lesson checkpoint

Now that you have reviewed some of the requirements for programming with the Rational ClearQuest API, you are ready to learn about the Session object of the Rational ClearQuest API and how to begin programming with the API.
< Previous | Next >