I'm trying to parse a JSON string into an array reference:
my $str = '[[2],[1]]';
my $data = map { $_->[0] } @{decode_json( $str )};
but this makes it a scalar. I can do:
my $str = '[[2],[1]]';
my @data = map { $_->[0] } @{decode_json( $str )};
my $data = \@data;
but it's not as short as I like. any help?