$json->encode( [ f() ] ) #### my $s = f(); my @a = f(); #### my $s = $json_decode(...)->[0]; my @a = @{ $json_decode(...) };