use Win32::SqlServer; do { my $connection; eval { $connection = new Win32::SqlServer(); die 'aargh!' } if ($@) { print "Error: $@"; }; };