>>>>> "Douglas" == Douglas McNaught <doug@mcnaught.org> writes:
Douglas> my $dbh;
Douglas> eval { $dbh = connect(...) };
Since eval returns its value (or undef if $@ has the error), you can shorten
this to:
my $dbh = eval { DBI->connect(...) };
and now either look at $@ (if you want to distinguish exception vs normal) or
just defined $dbh (if you want to know if you have a useful handle or not).
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!