Hi all, i am using the following code to that use curl to that outputs a json, i am stuck it into a hash but i canot figure out how to get just the value i need ( hostname)
here is my code
use warnings;
use strict;
use Data::Dumper qw(Dumper);
##use JSON;
use JSON::XS;
my $curl= `curl --sslv3 --silent --cookie /tmp/unifi_cookie --cookie-jar /tmp/unifi_cookie --insecure --data "login=login" --data "username=admin" --data "password=password" --data "json={}" https://wifi1:8443/api/stat/sta`;
my $json_text = $curl ;
my @decoded_json = decode_json($json_text);
foreach my $item ( @decoded_json ){
print Dumper$item;
}
and i want to get the vaule of just the hash vaule of 'hostname'
Thanks
A