title: How to set timeout for a long running Sybase sp in Perl
body: <p>I'm calling a stored procedure which deletes data from Sybase DB in a Perl. But the sp takes hours to complete.
  I just want the sp to run for 1 hour, then no matter whether it completes or not I want the codes afterwards to be running. How can I implement this?</p>
  
  <pre><code>sub DelRef {
      print "starting defRefData\n";
      $db = new Sybapi($user, $password, $server, $margin_database); 
      #the following sql will take hours
      $db-&gt;exec_sql("exec CPN_Margins..clean_up_refData_db '$XrefCode'");
  }
  
  &amp;DelRef();
  print "process is done\n";
  $db-&gt;close();
  </code></pre>