RE: Perl Issues

From: Jeremiah Wilton <>
Date: Thu, 21 Feb 2008 14:39:12 -0800
Message-ID: <002501c874da$95d4e870$c17eb950$@net> wrote:

> 1.  Can Exception Handling be easily done in Perl?  If so, any good
examples I can point them to?


use DBI;
my $dbh = DBI->connect(

                        'dbi:Oracle:','', '',
                        { ora_session_mode => 2, # / as sysdba
                          PrintError => 0  #Suppresses the automatic error
reporting to STDERR

) or die "Cannot connect: $DBI::errstr\n";

my $sth = $dbh->prepare(

                        "select foo from bar"
                        ) or print "Caught an exception preparing the
cursor: $DBI::errstr\n";
print "Duh, I'm still alive! Now I can do something since I know I caught an error\n";



Jeremiah Wilton
ORA-600 Consulting

Received on Thu Feb 21 2008 - 16:39:12 CST

Original text of this message