in reply to Gearman::Client Return Value

I'm not familiar with the module in question, but the line in question reads:

my $rv = ref $ret ? $$ret : $ret;

It checks if what was returned was a reference, and if so dereferences it for return assuming it was a scalar. That seems strange to me, but perhaps it makes sense in the broader context the module was intended for. You could perhaps try "out thinking" it by returning a ref to an array ref (return \\@new_string;), but that smacks of trouble to me. I would think since this seems to involve a serialization protocol, you'd just end up with a stringified reference in that case. What would seem more logical to me would be to plan on returning a delimited string in place of your array in the true case, and splitting in the client function.