Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Redis CPAN distribution.

Report information
The Basics
Id: 55507
Status: resolved
Priority: 0/
Queue: Redis

People
Owner: melo [...] cpan.org
Requestors: will.conant [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: __read_multi_bulk should probably return an array reference
Date: Fri, 12 Mar 2010 13:06:01 -0700
To: bug-Redis [...] rt.cpan.org
From: Will Conant <will.conant [...] gmail.com>
It is currently awkward to distinguish an empty array result from a null result. Right now, I do this: my @result = $redis->lrange("foo", 0, 5); if (scalar(@result) == 1 && !defined($result[0])) { # The key was missing. Empty the array before using it. @result = (); } foreach my $item (@result) { ... } If, instead, multi-bulk commands returned undef or an array reference, I could do this: foreach my $item (@{ $redis->lrange("foo", 0, 5) || [] }) { ... } Thank you! -- Will Conant
Hi, this should be fixed in the latest release 1.901. NIL responses will return undef. Empty lists return []. Thanks,