title: perl database connection using fetchrow command
body: <p>I am using perl code to connect to database.Is the below a compilation error? </p>
  
  <pre><code>my $source_id = $syb_qp-&gt;fetchrow();
  </code></pre>
  
  <p>The RHS is returning an array. LHS is a scalar.</p>
  
  <p>Below is the part of it</p>
  
  <pre><code>my $syb_query="SELECT ms.source_id
                  from message ms,message_ mpt
                  where ms.msg=mpt.msg and mpt.pattern='$pattern'
                  and ms.id = '$invid'" ;
  my $syb_qp = $dbs-&gt;prepare($syb_query);
  $syb_qp-&gt;execute();
  my $source_id = $syb_qp-&gt;fetchrow();
  </code></pre>
  
  <p>And after that I am inserting in a table the $source_id as-</p>
  
  <p>my $syb_query_insert="INSERT INTO invocati (date,id,source,log_m,log_f) VALUES('date',ABC,<strong>$source_id</strong>,'$pattern','$file')";</p>
  
  <p>will the above code will work fine.</p>
  
  <p>Any help will be appreciated.</p>