title: Using Perl and MySql, how can I check for an empty result?
body: <p>Way oversimplified example:</p>
  
  <pre><code># Get Some data
  $query = $db-&gt;prepare(qq{
      select * from my_table where id = "Some Value"
  });
  $query-&gt;execute;
  
  # Iterate through the results
  if ( *THE QUERY HAS RETURNED A RESULT* ) {
      print "Here is list of IDs ";
      while ($query_data = $query-&gt;fetchrow_hashref) {
          print "$query_data-&gt;{id}";
      }
  };
  </code></pre>
  
  <p>Looking for the code for "THE QUERY HAS RETURNED A RESULT" up there. I'd like to avoid using count(*) in my SQL if possible, since that will require a "group by".</p>