Hi, Yoichi,
Yoichi Takayama wrote:
> So, I am actually using something like:
>
> my $q = new CGI;
>
> my $dbh = DBI->connect($dbs) || errHandler( $DBI::errStr );
> .
> . (more codes which calls errHandler)
> .
> .
> exit;
And exactly this could be rewritten as follows:
eval {
my $dbh = DBI->connect($dbs, undef, undef, {RaiseError => 1});
# ... more Code using DBI calls and not looking for error
# messages
};
errHandler($@) if $@;
I am using this in CGI´s all the time. Even better, HTML::EP has builtin
support for exactly that.
Bye,
Jochen
--
Jochen Wiedmann joe@stripped
Life has brown and green eyes. :-) +49 7123 14887