Thread String parsen
(4 answers)
Opened by fasel at 2014-12-02 15:00
JSON gibts dafür. ;)
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 my $data = <<'DATA'; {"foo":[ {"a":"aA","b":"bA","c":"cA"}, {"a":"aB","b":"bB","c":"cB"}, {"a":"aC","b":"bC","c":"cC"} ]} DATA use JSON; my $json = JSON->new->utf8; my $perl_scalar = $json->decode( $data ); Siehe https://metacpan.org/pod/JSON#decode_json print $perl_scalar->{foo}[1]->{a}; ergibt dann: aB Last edited: 2014-12-02 15:31:24 +0100 (CET) |