Re: [svn:dbi] r14361 - dbi/trunk/t

Tim Bunce <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Mon, Aug 30, 2010 at 01:49:10PM -0700, [email protected] wrote:
> Log:
> Fix for failing t/50 when old SQL::Statement available (e.g. 1.16)

Does this fix http://www.cpantesters.org/cpan/report/8392757 ?

>  my $dbi_sql_nano = $ENV{DBI_SQL_NANO};
>  unless( $dbi_sql_nano ) {
> -    $@ = undef;
> +    my $haveSS = 0;
>      eval {
>  	require SQL::Statement;
> +	$haveSS = DBD::DBM::Statement->isa('SQL::Statement');
>      };
> -    $@ and $dbi_sql_nano = 1;
> +    $dbi_sql_nano = !$haveSS;
>  }

Could this:

>  my $dbi_sql_nano = $ENV{DBI_SQL_NANO};
>  unless( $dbi_sql_nano ) {
>      my $haveSS = 0;
>      eval {
>  	 require SQL::Statement;
>  	 $haveSS = DBD::DBM::Statement->isa('SQL::Statement');
>      };
>      $dbi_sql_nano = !$haveSS;
>  }

be expressed as:

   my $dbi_sql_nano = $ENV{DBI_SQL_NANO};
   unless( $dbi_sql_nano ) {
       $dbi_sql_nano = not eval {
   	 require SQL::Statement;
   	 DBD::DBM::Statement->isa('SQL::Statement');
       };
   }

or even

   # use Nano if requested or if SQL::Statement isn't usable for DBD::DBM
   my $dbi_sql_nano = $ENV{DBI_SQL_NANO} || not eval {
        require SQL::Statement; DBD::DBM::Statement->isa('SQL::Statement')
    };

Tim.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.