[Israel.pm] Class::DBI with several databases from the same script

Yuval Yaari yuval at windax.com
Thu Jun 3 03:06:47 PDT 2004


I just use different base classes for my table classes.
This is also what Tony replied to you on the CDBI mailing list :)
I'm just trying to figure out if there's a reason not to use this...

What I mean:
package My::DBI1;
use base 'Class::DBI';
# Connect to DB 1...

package My::DBI2;
use base 'Class::DBI';
# Connect to DB 1...

package My::Table1
use base 'My::DBI1';
# set table for a table on DB 1

package My::Table2
use base 'My::DBI2';
# set table for a table on DB 2


  --Yuval

Gabor Szabo said:
>
> In version 0.96 of Class::DBI it can be done already, just the
> documentation is a bit lacking.
>
> Anyway here is my code.
> Any corrections, ideas are welcome.






More information about the Perl mailing list