TIMTOWDI :>)
In principle, the application have to know, which connection it wants to use. My recently used solution is, __briefly__:
#configuration
my $conf = "
<MyConfPool>
<connection id="firstconn">
...DSN credentials
</connection>
<connection id="secondconn">
...DSN credentials
</connection>
</MyConfPool>";
#create object holding connections
use MyConnPool;
my $conn_pool = MyConnPool->new(conf=>$conf);
...
#use some connection
my $conn1 = $conn_pool->get("firstconn");
$conn1->Sql(...);
my $conn2 = $conn_pool->get("secondconn");
$conn2->Sql(...);
The goal is to implement whole maintenance of connections in that slightly described module, other parts of application will just use it, not carrying if connection is already opened e.t.c.