I don't know what will be in those functions, but would like to serialize to as correct JSON as possible.
Functions return lists of scalars. It is as correct as possible to transmit a list of scalar. You could use a JSON array for that.
$json->encode( [ f() ] )
The equivalent of
my $s = f(); my @a = f();
is
my $s = $json_decode(...)->[0]; my @a = @{ $json_decode(...) };
In reply to Re^3: Detecting type of output from subs
by ikegami
in thread Detecting type of output from subs
by mogul
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |