incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Rhoden <jacob.rho...@me.com>
Subject Re: List support in Net::Async::CassandraCQL ?
Date Sun, 23 Feb 2014 02:06:54 GMT
Hi Paul,

On 23 Feb 2014, at 4:15 am, Paul LeoNerd Evans <leonerd@leonerd.org.uk> wrote:
> On Sat, 22 Feb 2014 14:03:06 +1100 Jacob Rhoden <jacob.rhoden@me.com> wrote:
>>    my $q = $cass->prepare("update contact set name=?, address=?
>> where uuid=?")->get; push @f, $q->execute([$name, @address, $uuid]);
>>    Future->needs_all( @f )->get;
>> 
>> Returns the following:
>> 
>>    Cannot encode address: not an ARRAY
>> at /usr/local/share/perl/5.14.2/Net/Async/CassandraCQL/Query.pm line
>> 182
> 
> It needs to arrive as an ARRAYref:
> 
>  $q->execute([$name, \@address, $uuid]);


Thanks! I did try this without success. Perhaps I am just making a simple perl mistake then?
I’ve been doing java so long, my perl is a little rusty:

        my @address = ();
        if(defined $a1 && $a1 ne "") {
            push @address, $a1;
        }
        if(defined $a2 && $a2 ne "") {
            push @address, $a2;
        }
        if(defined $a3 && $a3 ne "") {
            push @address, $a3;
        }

        my @f;
        my $q = $cass->prepare("update contact set name=?, address=? where uuid=?")->get;
        push @f, $q->execute([$name, \@address, $uuid]);
        Future->needs_all( @f )->get;

But this also returns an error:

    Cannot encode address: not an ARRAY at /usr/local/share/perl/5.14.2/Net/Async/CassandraCQL/Query.pm
line 182


Mime
View raw message