-
-
Save sky-joker/071c60b47dfe22396db9cbdc025f7879 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use JSON; | |
my $json = JSON->new(); | |
my @array = (); | |
my %list = (); | |
# 1個目 | |
$list{'{#NAME}'} = "EXAMPLE1"; | |
$list{'{#STAT}'} = "UP"; | |
push(@array, $json->decode($json->encode(\%list))); | |
# 2個目 | |
$list{'{#NAME}'} = "EXAMPLE2"; | |
$list{'{#STAT}'} = "UP"; | |
push(@array, $json->decode($json->encode(\%list))); | |
undef(%list); | |
$list{'data'} = \@array; | |
print $json->encode(\%list), "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment