我继承了一个脚本,我需要能够从哈希中访问一些数据。我希望能够从以下访问 MB_Path 值。
$VAR1 = bless(
{
'ME_Parts' => [
bless(
{
'ME_Bodyhandle' => bless(
{
'MB_Path' => '/tmp/msg-15072-1.txt'
},
'MIME::Body::File'
),
'ME_Parts' => [],
'mail_inet_head' => bless(
{
'mail_hdr_foldlen' => 79,
'mail_hdr_modify' => 0,
'mail_hdr_list' => [
'Content-Type: text/plain; charset="us-ascii"',
'Content-Transfer-Encoding: quoted-printable'
],
'mail_hdr_hash' => {
'Content-Type' => [
\$VAR1->{'ME_Parts'}[0]{'mail_inet_head'}
{'mail_hdr_list'}[0]
],
'Content-Transfer-Encoding' => [
\$VAR1->{'ME_Parts'}[0]{'mail_inet_head'}
{'mail_hdr_list'}[1]
]
},
'mail_hdr_mail_from' => 'KEEP',
'mail_hdr_lengths' => {}
},
'MIME::Head'
)
},
'MIME::Entity'
),
bless(
{
'ME_Bodyhandle' => bless(
{
'MB_Path' => '/tmp/msg-15072-2.html'
},
'MIME::Body::File'
),
'ME_Parts' => [],
'mail_inet_head' => bless(
{
'mail_hdr_foldlen' => 79,
'mail_hdr_modify' => 0,
'mail_hdr_list' => [
'Content-Type: text/html;charset="us-ascii"',
'Content-Transfer-Encoding: quoted-printable'
],
'mail_hdr_hash' => {
'Content-Type' => [
\$VAR1->{'ME_Parts'}[1]{'mail_inet_head'}
{'mail_hdr_list'}[0]
],
'Content-Transfer-Encoding' => [
\$VAR1->{'ME_Parts'}[1]{'mail_inet_head'}
{'mail_hdr_list'}[1]
]
},
'mail_hdr_mail_from' => 'KEEP',
'mail_hdr_lengths' => {}
},
'MIME::Head'
)
},
'MIME::Entity'
)
],
'ME_Epilogue' => [],
'ME_Preamble' => [],
'mail_inet_head' => bless(
{
'mail_hdr_foldlen' => 79,
'mail_hdr_modify' => 0,
'mail_hdr_list' => [
'Content-Type: multipart/alternative;boundary="----_=_NextPart_002_01CEB949.DC6B0180"'
],
'mail_hdr_hash' => {
'Content-Type' =>
[ \$VAR1->{'mail_inet_head'}{'mail_hdr_list'}[0] ]
},
'mail_hdr_mail_from' => 'KEEP',
'mail_hdr_lengths' => {}
},
'MIME::Head'
)
'MIME::Entity'
);
我以为我可以简单地执行以下操作
print $ent->parts->($i)->{ME_Bodyhandle}->{MB_Path};
但是,当我这样做时,我得到并错误地指出该值未初始化。但是当我转储时,$ent->parts->($i)
我得到了上面的代码。
我只是坚持这个。谢谢,狮子座C