出于调试目的,我必须打印下面的哈希值。有些人可以帮助我解决这个问题,因为我在复杂的数据结构方面并不陌生:
use strict;
use warnings;
my $issueMap;
$issueMap = {
'project' => SOAP::Data->type(string => "abc"),
'type' => SOAP::Data->type(string => "3"),
'summary' => SOAP::Data->type(string => $title), #issueDesc
'description' => SOAP::Data->type(string => $issueDesc),
'components' => [{'id' => SOAP::Data->type(string => $component_id)}],
'customFieldValues' => SOAP::Data->type('Array' => [
{ 'customfieldId' => SOAP::Data->type(string => 'customfield_10933'), values => [ SOAP::Data->type(string => $acbPath) ] },
{ 'customfieldId' => SOAP::Data->type(string => 'customfield_10934'), values => [ SOAP::Data->type(string => $Path) ] },
{ 'customfieldId' => SOAP::Data->type(string => 'customfield_10935'), values => [ SOAP::Data->type(string => $logPath) ] },
{ 'customfieldId' => SOAP::Data->type(string => 'customfield_10071'), values => [ SOAP::Data->type(string => "PROD") ] },
{ 'customfieldId' => SOAP::Data->type(string => 'customfield_10544'), values => [ SOAP::Data->type(string => $check_area) ] },
{ 'customfieldId' => SOAP::Data->type(string => 'customfield_10842'), values => [ SOAP::Data->type(string => "Unavailable") ] },
{ 'customfieldId' => SOAP::Data->type(string => 'customfield_14927'), values => [ SOAP::Data->type(string => "Unavailable") ] },
{ 'customfieldId' => SOAP::Data->type(string => 'customfield_14930'), values => [ SOAP::Data->type(string => $mcn) ] }, #MCN
{ 'customfieldId' => SOAP::Data->type(string => 'customfield_14929'), values => [ SOAP::Data->type(string => $serialno) ] }, #SERIAL
{ 'customfieldId' => SOAP::Data->type(string => 'customfield_10060'), values => [ SOAP::Data->type(string => "$user_runner") ] } #user
])
};
Debug
foreach my $check (%{$issueMap})
{
print $issueMap ->$check."\n";
}
Error : Can't call method "customFieldValues" on unblessed reference during printing hash.
答案 0 :(得分:2)
我开始使用DDP
(Data::Printer
的缩写),它提供了一个更干净,漂亮的彩色和灵活的输出,而不是在屏幕上产生两到三次的大量页面。< / p>
use DDP;
p $issueMap;
查看Customization of Data::Printer的许多选项,例如expand
,以便深入了解您的结构。