2010/8/31 Tim Bunce <tim.bu...@pobox.com>: > On Mon, Aug 30, 2010 at 01:49:10PM -0700, hmbr...@cvs.perl.org 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 ?
No, because this fixes t/50dbm_simple.t and the error is in t/51dbm_file.t >> 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'); > }; > } I made a quick fix and send it to Tux for testing - and he committed instantly. I'll handle that together with the win32 issue (http://www.cpantesters.org/cpan/report/8392757) before Sunday. > 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') > }; If we shorten that all, we don't need to require SQL::Statement. This will be done in DBI::SQL::Nano. Following would be enough: # use Nano if requested or if SQL::Statement isn't usable for DBD::DBM my $dbi_sql_nano = not eval { DBD::DBM::Statement->isa('SQL::Statement'); }; Or, if we can assume that DBD::DBM can always successfully loaded: my $dbi_sql_nano = not DBD::DBM::Statement->isa('SQL::Statement'); /Jens