title: Perl try/catch block throws error in Error.pm
body: <p>I have the following code in in a Perl script I'm writing:</p>
  
  <pre><code>#!/usr/bin/perl
  use DBI;
  use Getopt::Long;
  use Time::HiRes;
  use Error qw(:try);
  
  ....
  
  my $starttime = Time::HiRes::time;
  
  try {
      my $dbh = DBI-&gt;connect("dbi:Sybase:$server", $username, $password);
      $dbh-&gt;do("use $database");
      my $query="exec OfflineDatabaseReport";
  
      $row = $dbh-&gt;selectrow_hashref($query);
  
      $dbh-&gt;disconnect();
  } catch Error with {
      print "boom";
      exit 1;
  };
  my $endtime = Time::HiRes::time;
  my $timetaken = $endtime - $starttime;
  </code></pre>
  
  <p>The script worked fine until I wrapped the data access portion in the <code>try...catch</code> block. Now I get the following exception thrown:</p>
  
  <blockquote>
    <p>Can't use string ("1316135985.90893") as a HASH ref while "strict refs" in use at /usr/lib/perl5/site_perl/5.8.8/Error.pm line 217.</p>
  </blockquote>
  
  <p>I did try setting:</p>
  
  <pre><code>no strict "refs";
  </code></pre>
  
  <p>But I still get the same error. Am I being naive in my usage of a <code>try/catch</code> block here?</p>