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'}]
From CPAN I got a module called Convert/PerlRef2String
http://search.cpan.org/~kaili/Convert-PerlRef2String-0.03/lib/Convert/PerlRef2String.pm
But for that i want to encode the string to base64 and then want to give the string as parameter for string2perlref($string);
Is it advisable. Please help me.
Thanks,
Prabu
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
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
C:\home>
Thanks a ton that helped me a lot....
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-...@perl.org
For additional commands, e-mail: beginne...@perl.org
http://learn.perl.org/