#!/usr/bin/perl --
use strict;
use warnings;
use Data::Dump qw/ dd pp /;
use JSON qw/ to_json from_json /;
my $str = q{["listliteral",["ListLiteral",["../classSPL_1_1Operator_1_
+1Instance_1_1ExpressionTree_1_1ListLiteral.html",1,"SPL::Operator::In
+stance::ExpressionTree"]]]};
dd( from_json( $str ) );
__END__
[
"listliteral",
[
"ListLiteral",
[
"../classSPL_1_1Operator_1_1Instance_1_1ExpressionTree_1_1ListLi
+teral.html",
1,
"SPL::Operator::Instance::ExpressionTree",
],
],
]
Oh, but you say I switched the single quotes for the double quotes ... :P
Well, what you do have is also perl, so use Safe #!/usr/bin/perl --
use strict;
use warnings;
use Data::Dump qw/ dd pp /;
use Safe;
my $str = q{["listliteral",["ListLiteral",["../classSPL_1_1Operator_1_
+1Instance_1_1ExpressionTree_1_1ListLiteral.html",1,"SPL::Operator::In
+stance::ExpressionTree"]]]};
dd( Safe->new->reval( $str ) );
__END__
[
"listliteral",
[
"ListLiteral",
[
"../classSPL_1_1Operator_1_1Instance_1_1ExpressionTree_1_1ListLi
+teral.html",
1,
"SPL::Operator::Instance::ExpressionTree",
],
],
]
|