Sample code for 30+ languages & platforms
Perl Requires Chilkat v9.5.0.67+

JSON Append String Array

See more JSON Examples

Demonstrates how to append an array of strings from a string table object.

Chilkat Perl Downloads

Chilkat2 Perl
use strict;
use warnings;
use Chilkat2;

my $json = Chilkat2::JsonObject->new;
$json->EmitCompact(0);

$json->AppendString('abc', '123');

my $st = Chilkat2::StringTable->new;
$st->Append('a');
$st->Append('b');
$st->Append('c');
$st->Append('d');

$json->AppendStringArray('strArray', $st);

print $json->Emit(), "\n";

# Output:

#     {
#       "abc": "123",
#       "strArray": [
#         "a",
#         "b",
#         "c",
#         "d"
#       ]
#     }