Help making list form query results perl and soap lite

Version 1

    Subject: RE: Help making list form query results perl and soap lite
    Replied by: Martin Sloan on 02-03-2012 09:35:00 AM
    Hi Erick,

    I think this should accomplish what you're looking for:

    unless ($res->fault) {
        my( $reply ) = $res->paramsall();
        $desc = $reply->{row};
        foreach(@$desc) {
    print "$_->{description}\n";
        }
    }

    HTH!

    Marty
    This document was generated from CDN thread

    Created by: Erick Wellnitz on 02-03-2012 09:04:36 AM
    I have a query which returns several rows of data which is in bold.  When I print the result $res, it prints all results but not in a nice format.  Something like:  'Desc 1Desc 2Desc 3' and so on.  If I concatenate a newline character, it only prints the first value.  How do I get it to print the results as a nice list.  It is probably obvious but I'm drawing a blank. 
     
    code below:
     
    #!/Program Files/Cisco/perl
    use strict;
    use warnings;
    use SOAP::Lite +trace => 'debug';
    use Data:umper;
    use MIME::Base64;
    #define variables
    my $cucmip;
    my $axl_port = "8443";
    my $user;
    my $password;
    my $error_text;
    my $sql = "select description from device where description like '%Eri%'";
    #get CUCM IP, username and password
    print "Communications Manager IP: ";
    $cucmip = <>;
    print "AXL Username: ";
    $user = <>;
    chomp($user);
    print "AXL User Password: ";
    $password = <>;
    chomp($password);
    #set up soap
    my $cm = new SOAP::Lite
    encodingStyle => '',
    uri => 'http://www.cisco.com/AXL/API/1.0',
    proxy => "https://$cucmip:$axl_port/axl/" ;
    #disable certificate check
    BEGIN { $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0 }
    #authenticate to CUCM
    $cm = Login($cm,"$user","$password");
    #axl request
    my $axldata = SOAP:ata->name( "sql" => $sql );
    my $res = $cm->executeSQLQuery( $axldata );
    #show the returned value
    unless ($res->fault)
    {
     print $res ->valueof('//description');
    }
    else
    {
     $error_text = $res->faultcode.' '.$res->faultstring."\n";
     print $error_text
    }
    ################################################
    sub Login
    {
     $cm->transport->http_request->header (
     'Authorization' => 'Basic ' . encode_base64("$user:$password", ''));
     return $cm;

    Subject: RE: Help making list form query results perl and soap lite
    Replied by: Erick Wellnitz on 02-03-2012 10:14:19 AM
    That does it.  I just had to declare $desc.   Learning more and more about Perl every day!


    Thanks!

    Subject: RE: Help making list form query results perl and soap lite
    Replied by: Martin Sloan on 02-03-2012 12:24:45 PM
    Hey Erick,

    Glad it worked for you!  I'm in the same boat man.  Perl is a lot of fun and this same issue really gave me some trouble for a bit. 

    Good luck!

    Marty