From: Don Armstrong Date: Wed, 6 May 2015 16:32:08 +0000 (-0700) Subject: output no results when there are no results X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=683c8aef9d3cf8660d2ed553809ea385c8d9e465;p=bin.git output no results when there are no results --- diff --git a/pubmed_search b/pubmed_search index 435f753..23333ea 100755 --- a/pubmed_search +++ b/pubmed_search @@ -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]};