Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
Convert from String to Hash and loop it and Print it



nkishorech
New User

May 5, 2009, 1:40 PM


Views: 3524
Convert from String to Hash and loop it and Print it

I am getting the output as string in below format.First I need to convert to Hash and then loop throught it.

here is the code:

$ssmb_request = (
'request' => {
'acctno'=> 'XXXXXXX',
'prdtypcd'=> 'XXXXXXXX',
'sectyp' => 'XXXX'
},
'response' => {
'buypwr' => '361926.00',
'secdettbl' =>
{
'accttyp' => 'cash',
'accttyp_code' => '1',
'secdesc4' => '',
'secfmtflg' => '',
'secfmtflg_code' => '1'
} ,
},

);



How do u convert from String to HASH and loop throught it and print the all key and values in each level.



thanx in advance..