title: Is it better to croak() or to die() when something bad happens in Perl?
body: <p><a href="http://search.cpan.org/~thaljef/Perl-Critic-1.118/bin/perlcritic" rel="noreferrer">perlcritic</a> complaints that the following code, some boilerplate DBI stuff that works perfectly fine, should <a href="http://perldoc.perl.org/Carp.html#SYNOPSIS" rel="noreferrer"><code>croak</code></a> instead of <a href="http://perldoc.perl.org/functions/die.html" rel="noreferrer"><code>die</code></a>:</p>
  
  <pre><code># Connect to database
  my $db_handle = DBI-&gt;connect( $url, $user, $password ) or die $DBI::errstr;
  </code></pre>
  
  <p>All this, while die seems to work fine for me. </p>
  
  <p>I would think for a samurai Perl warrior, croak is less honorable than actually die when things go awry. Jokes apart</p>
  
  <p>Why should I <code>croak</code> instead of <code>die</code>?</p>
  
  <p>What are the consequences of not heeding <a href="http://search.cpan.org/~thaljef/Perl-Critic-1.118/bin/perlcritic" rel="noreferrer">perlcritic's</a> advice?</p>