Subject: | select_one_to_array problem |
sub select_one_to_array doesn't indicate errors correctly.
This sub is called as @list = $obj->select_one_to_array(...)
If there's no data, it should return an empty list.
Right now, it returns a list of 1 element: ( undef ) instead of an empty list: ()
This following code:
my $result = $db->fetchrow_arrayref;
return undef unless $result;
Should best be replaced with:
my $result = $db->fetchrow_arrayref or return;
In fact, this can be used in the other similar methods (select_one_to_hashref, select_one_to_arrayref) because "return"
without arguments has the wonderful feature of returning undef in scalar context, or an empty list in array context.
Thank you,
Alex Manousakis