Prabu Ayyappan wrote:
I want to convert a string into a Hash data structure
For Example
String:
"[['aaa',{27' => '543','21' => '111','Client' => '543','chat' => '111'}]]"
Hash:
[['aaa',{27' => '543','21' => '111','Client' => '543','chat' => '111'}]
C:\home>type test.pl
use Data::Dumper;
$string = "['aaa',{'27' => '543','21' => '111',
'Client' => '543','chat' => '111'}]";
$ref = eval $string;
print Dumper $ref;
C:\home>test.pl
$VAR1 = [
'aaa',
{
'27' => '543',
'21' => '111',
'Client' => '543',
'chat' => '111'
}
];
C:\home>
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/