List:MySQL and Perl« Previous MessageNext Message »
From:Jochen Wiedmann Date:October 8 1999 9:03am
Subject:Re: placeholder funny w msql-mysql-modules-1.2207
View as plain text  
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


Thread
placeholder funny w msql-mysql-modules-1.2207colin6 Oct
  • Re: placeholder funny w msql-mysql-modules-1.2207Yoichi Takayama7 Oct
  • Re: placeholder funny w msql-mysql-modules-1.2207Jochen Wiedmann7 Oct
    • Re: placeholder funny w msql-mysql-modules-1.2207colin7 Oct
    • Re: placeholder funny w msql-mysql-modules-1.2207Hugo7 Oct
    • Re: placeholder funny w msql-mysql-modules-1.2207Jochen Wiedmann7 Oct
      • Re: placeholder funny w msql-mysql-modules-1.2207colin7 Oct
      • Re: placeholder funny w msql-mysql-modules-1.2207Hugo7 Oct
    • Re: placeholder funny w msql-mysql-modules-1.2207Jochen Wiedmann8 Oct
      • Re: placeholder funny w msql-mysql-modules-1.2207colin8 Oct
Re: placeholder funny w msql-mysql-modules-1.2207colin7 Oct
  • Re: placeholder funny w msql-mysql-modules-1.2207Yoichi Takayama7 Oct
    • Re: placeholder funny w msql-mysql-modules-1.2207Jochen Wiedmann7 Oct
      • Re: placeholder funny w msql-mysql-modules-1.2207colin7 Oct
    • Re: placeholder funny w msql-mysql-modules-1.2207Jochen Wiedmann8 Oct
      • Re: placeholder funny w msql-mysql-modules-1.2207Yoichi Takayama9 Oct
  • Re: placeholder funny w msql-mysql-modules-1.2207Rob Huffstedtler7 Oct
Re: placeholder funny w msql-mysql-modules-1.2207Yoichi Takayama8 Oct