I have a string of formatted data that I would like to push to an array, but my Perl skills are lacking.
The string is:
'ShoreTelCallStateInfo' => [
{
'callStateDetail' => 'Active',
'callState' => 'OnHold',
'callInfo' => {
'callerIDName' => 'Joel Lewis',
'callID' => '66766',
'lineID' => '3947',
'connectedIDName' => 'VM-Forward',
'calledID' => '2105',
'callerID' => '1955',
'isInbound' => 'false',
'calledIDName' => 'VM-Forward',
'callReason' => 'None',
'callUniqueID' => '2488927099',
'connectedID' => '2105',
'isExternal' => 'false',
'callGUID' => '{00030000-67CA-537E-3FD8-0010492377D9}'
}
},
{
'callStateDetail' => 'Active',
'callState' => 'Connected',
'callInfo' => {
'callerIDName' => 'Lewis Joel',
'callID' => '73202',
'lineID' => '3947',
'connectedIDName' => 'Lewis Joel',
'calledID' => '1955',
'callerID' => '+1385#######',
'isInbound' => 'true',
'calledIDName' => 'Joel Lewis',
'callReason' => 'None',
'callUniqueID' => '2193468845',
'connectedID' => '+1385#######',
'isExternal' => 'true',
'callGUID' => '{00030000-6809-537E-3FD8-0010492377D9}'
}
}
]
};
I have tried to simply create the array and assign the string, but this is not working:
my @magicarray = $string;
Is there a quick way to initialize this array with the formatted data?