Try to use Data::dumper to see a structure if a parsed response

 my $xcp_request = {
                action => "get",
                object => "domain",
                cookie => $cookie,
                attributes => {
                    page => $page,
                    type => "list",
                    with_encoding_types => 1,
                    }
            };

 my $response = $XML_Client->send_cmd( $xcp_request );
 use Data::Dumper;
 print Dumper ( $response);



WebWiz wrote:

> In manage.cgi, there's a function called "view_domains"
> which will show a list of all domains in the current
> profile.
>
> The command that's sent to the server is:
>
>     my $xcp_request = {
>           action => "get",
>           object => "domain",
>           cookie => $cookie,
>           attributes => {
>             page => $page,
>             type => "list",
>           }
>      };
>
> According to the docs, the XML that's returned includes
> an "ext_results" section that's keyed on the domain name
> and includes the auto_renew flag and the domain's expiration
> date.
>
> How the heck do I access this (this whole XML thing in Perl
> is new to me, and I'm wrapped around the axle with scalars,
> arrays, hashes and who knows what else).
>
> Within the loop where we're stepping through domain names, and
> the current one is assigned to $domain_name, I tried:
>
>  my $expiration =
> $response->{attributes}->{ext_results}->{$domain_name}->{expiredate};
>
> But Perl complained that there was no subkey named "adomain.com" (where
> adomain.com
> is the first one in the profile).
>
> What's the right syntax??  (FWIW, this is V2.21 of manage.cgi)
>
> Regards,
> Eric Longman
> Atl-Connect Internet Services
>
> +-------------------------------------------------------+
> | Atl-Connect Internet Services   http://www.atlcon.net |
> | 3600 Dallas Hwy Ste 230-288              770 590-0888 |
> | Marietta, GA 30064-1685            [EMAIL PROTECTED] |
> +-------------------------------------------------------+

--
Evgeniy
OpenSRS developer



Reply via email to