]> git.donarmstrong.com Git - bin.git/commitdiff
output no results when there are no results
authorDon Armstrong <don@donarmstrong.com>
Wed, 6 May 2015 16:32:08 +0000 (09:32 -0700)
committerDon Armstrong <don@donarmstrong.com>
Wed, 6 May 2015 16:32:08 +0000 (09:32 -0700)
pubmed_search

index 435f75392c9f61aca496c7c7229744b4e45c5e65..23333ea3004257c94b48930759ecc996087c84ab 100755 (executable)
@@ -93,6 +93,10 @@ my $result = $fac->esearch(-email => 'don@donarmstrong.com',
                            -term => join(' ',@ARGV),
                            -retmax => 1000,
                           )->run();
+if ($result eq '0') {
+    print "No results\n";
+    exit;
+}
 my @ids = $result->ids;
 if (@ids > 0 and ref($ids[0])) {
     @ids = @{$ids[0]};