All -
I'm trying to do something I haven't done before. It looks like the perl module I am using is returning a reference to a hash. I know that the actual returned data is an XML document. What is the best way to actually get to the XML document from the hash reference? I've tried XML::Twig parse->(%hash) but that didn't work. The code and results are just below.
Thanks!
use NaServer;
my $host = shift;
my $user = shift;
my $pw = shift;
if ($user eq "") {
print("Usage: You need - host user passwd");
exit(-1);
}
my $s = NaServer->new($host, 1, 3);
$s->set_style(LOGIN_PASSWORD);
$s->set_admin_user($user, $pw);
$s->set_transport_type(
NA_SERVER_TRANSPORT_HTTPS);
my %out = $s->invoke(
"aggr-list-info");
@keys = keys %out;
@values = values %out;
while ($#keys >= 0) {
print pop(@keys), '=', pop(@values), "\n";
}
0;
Returns -
NaElement=HASH(0x83e8640)=
I'm trying to do something I haven't done before. It looks like the perl module I am using is returning a reference to a hash. I know that the actual returned data is an XML document. What is the best way to actually get to the XML document from the hash reference? I've tried XML::Twig parse->(%hash) but that didn't work. The code and results are just below.
Thanks!
use NaServer;
my $host = shift;
my $user = shift;
my $pw = shift;
if ($user eq "") {
print("Usage: You need - host user passwd");
exit(-1);
}
my $s = NaServer->new($host, 1, 3);
$s->set_style(LOGIN_PASSWORD);
$s->set_admin_user($user, $pw);
$s->set_transport_type(
NA_SERVER_TRANSPORT_HTTPS);
my %out = $s->invoke(
"aggr-list-info");
@keys = keys %out;
@values = values %out;
while ($#keys >= 0) {
print pop(@keys), '=', pop(@values), "\n";
}
0;
Returns -
NaElement=HASH(0x83e8640)=