title: Try Catch in Perl without external library
body: <p>I'm generating a Perl code from Java code and try to simulate the <code>try</code> <code>catch</code> mechanism.
  I cannot use external libraries. I found two possible methods to simulate this behavior:</p>
  
  <p>First one:</p>
  
  <pre><code>eval {
       ...
  };
  if ($@) {
       errorHandler($@);
  }
  </code></pre>
  
  <p>Second:</p>
  
  <pre><code>unless(.....){
      // handle the error
  }
  </code></pre>
  
  <p>My knowledge in Perl is very little. As I understand, the first solution enables me to execute multiple commands while the second solution enables me to execute only 1 command.
  But, I also saw that using eval is not recommended.</p>
  
  <p>What is the "right" way of doing it?</p>