correctly decode JSON arrays also in do_high
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 4 Oct 2011 12:05:47 +0000 (14:05 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 4 Oct 2011 12:05:47 +0000 (14:05 +0200)
lib/APKPM/Gearman/Client.pm

index 932bd5a..83078a7 100644 (file)
@@ -44,7 +44,7 @@ sub do_high {
 
        my $ret = $self->gc->do_task( $task );
        warn "## $func $args = ",dump($ret);
-       return $$ret =~ m/^{/ ? JSON::XS::decode_json($$ret) : $$ret;
+       return $$ret =~ m/^[{\[]/ ? JSON::XS::decode_json($$ret) : $$ret;
 }
 
 1;