Hi Paul,

On 23 Feb 2014, at 4:15 am, Paul LeoNerd Evans <leon...@leonerd.org.uk> wrote:
> On Sat, 22 Feb 2014 14:03:06 +1100 Jacob Rhoden <jacob.rho...@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

Reply via email to