Troubleshooting
Problem
In IBM Rational ClearQuest 8.0.1, cqperl and ratlperl are upgraded to Version 5.16.1. Previous ClearQuest versions shipped with cqperl and ratlperl Version 5.8.6. This technote describes some Perl script issues that you might encounter.
Symptom
A Perl script that functions in ClearQuest versions earlier than 8.0.1 has errors after upgrading to ClearQuest 8.0.1.
Cause
ClearQuest 8.0.1 uses Perl 5.16.1, which is stricter than Perl 5.8.6. In addition, Perl 5.16.1 has deprecated some Perl language capabilities or modules. As a result, scripts that were written for Perl 5.8.6 might result in errors when these are used in ClearQuest 8.0.1. The Perl Programming Documentation web site describes changes in each Perl release. Following is a summary of errors encountered during testing and suggested solutions.
- Scripts written for Perl 5.8.6 and used with ClearQuest 8.0.1 might have errors
HTTP Code: Error:Can't locate object method "previous" via package "Content" (perhaps you forgot to load "Content"?) at C:/Program Files (x86)/IBM/RationalSDLC/common/lib/perl5/site_perl/5.16.1/HTTP/Response.pm line 105.
Error Code:Error:Can't locate object method "previous" via package "Content" (perhaps you forgot to load "Content"?) at C:/Program Files (x86)/IBM/RationalSDLC/common/lib/perl5/site_perl/5.16.1/HTTP/Response.pm line 105.
Error Message: Error:Can't locate object method "previous" via package "Content" (perhaps you forgot to load "Content"?) at C:/Program Files (x86)/IBM/RationalSDLC/common/lib/perl5/site_perl/5.16.1/HTTP/Response.pm line 105.
Perl 5.16.1 might interpret ambiguous list context differently than Perl 5.8.6. In some cases, you might need to add parentheses to ensure that the list context is interpreted as expected by your Perl code. Without the parentheses, you might see errors similar to these:
Example
In the following example, additional parentheses are needed after
POST
and $content
when you use Perl 5.16.1:
$response = $ua->request(POST($api_url . '/defects/GTS/' . $resultset->GetColumnValue(1) . '/notes.xml',
Content_Type => 'application/xml',
Content => $content));
- Alternatives to using the switch.pm Perl module with cqperl or ratlperl
- Socket6 ratlperl 5.16.1 module requires the import call
In Perl Version 5.12 and later, the
switch.pm
module is no longer included with the standard distribution because it has been deprecated by the Perl organization. ClearQuest 8.0.1 continues to ship the switch.pm
module with Perl 5.16.1. However, customers should plan to stop using this module and move to the newer techniques. For more information, see Technote 1621637, Alternatives to using switch.pm Perl module with cqperl or ratlperl. Typically, you use
Socket6
with the require
command to use the Socket6
module, as shown in the following example:
use constant IPV6_IS_SUPPORTED =>
eval { require Socket6 } &&
eval { require IO::Socket::INET6 };
require
command alone causes errors. To eliminate errors, use the import
command along with the require
command, as shown in the following example:
use constant IPV6_IS_SUPPORTED =>
eval { require Socket6; Socket6->import; } &&
eval { require IO::Socket::INET6; IO::Socket::INET6->import };
- Reconnect to SSLv3 fails after a failed attempt to connect to SSLv23
In the file
/opt/rational/common/lib/perl5/site_perl/5.8.6/i686-linux-multi/Net/SSL.pm
, the default behavior is to connect to SSLv23. If this connection fails, the failover to SSLv3 does not work. To resolve this issue, you might need to change your script code to explicitly connect to SSLv3, as shown in the following example:
LWP::UserAgent->new(ssl_opts=>{'SSL_version'=>'SSLv3'})
- Adding Perl modules to ratlperl
The scripts that are included with Perl are located in the subdirectory where
ratlperl
is installed. To point to this Perl subdirectory, add the following path to the beginning of the user PATH environment variable: On UNIX:
/opt/rational/common/bin/perl
RationalCommonDirectory/perl
- Deprecated syntax in Perl 5.12 causes errors in ClearQuest 8.0.1
Perl 5.12 deprecates use of the
defined
function on hashes and arrays.Product Synonym
ClearQuest
Was this topic helpful?
Document Information
Modified date:
08 August 2018
UID
swg21639543