http://qs1969.pair.com?node_id=322860

!unlike has asked for the wisdom of the Perl Monks concerning the following question:

My problem is thus:

I am currnetly access a DB with DBI. Iwould like to migrate to Class::DBI. However one of my SELECT queries must query another database.

The problem is I do not have direct access to the DB. Some sample code should explain the problem:

use DBI; my $dbh = DBI->connect('dbi:mysql:database=db1' , 'user', 'password'); my $db1_data = $dbh->selectall_hashref(qq/select * from table where field = 'value'/); my $db2_data = $dbh->selectall_hashref(qq/select * from db2.table where field = 'value');

How do I achieve this with Class::DBI? My reading of the Class::DBI docs does not show if this is possible.

I agree that the correct solution would be to connect to db2 as I did to db1. However this isn't possible for "security reasons". Personally I disagree with this but it is not an argument that I will win. :(

!unlike

I write my Perl code like how I like my sex: fast and dirty. ;)