"remote": [
{
"host": "remotehost",
"name": "remotetest"
}
]
This bit is an array of objects (hashes in Perl). You cannot coerce it. You need to access the 1st element.
# A
# | B
# | | C
# | | |
$obj{'remote'}->[0]->{'host'}
Note there's no auth
in this, because that's on the same level as remote
(marked as A).
{
"auth" : {
"req": "1234",
"link": "http://localhost"
},
"host" : "localhost",
"name" : "mytest",
// A
"remote" : [ // B
{ // C
"host": "remotehost",
"name": "remotetest"
}
]
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…