santhosh_89 has asked for the wisdom of the Perl Monks concerning the following question:
I want to change the scalar value to some other context(array/hash references).
Actually my input will be as following.
Scalar will be a Input : '[1,'test',[{2=>3,3=>'test_56'},2,3,3]]'
If the scalar contains [],{}.I want change it to array-reference,hash-ref.
The output should be as following if i print by using dumper module.
Dumper output :
$VAR1 = [ 1, 'test', [ { '3' => 'test_56', '2' => 3 }, [ 2 ], [ 3 ], 3 ] ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to change the scalar value to some other context.
by ig (Vicar) on Jul 24, 2009 at 11:20 UTC | |
by santhosh_89 (Scribe) on Jul 24, 2009 at 11:52 UTC | |
by ig (Vicar) on Jul 24, 2009 at 12:05 UTC | |
|
Re: How to change the scalar value to some other context.
by Your Mother (Archbishop) on Jul 24, 2009 at 15:54 UTC | |
|
Re: How to change the scalar value to some other context.
by scorpio17 (Canon) on Jul 24, 2009 at 13:13 UTC |