Advertisement
Guest User

Untitled

a guest
Aug 1st, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. connection 1: $dbh->oracle;
  2. connection 2: $dbh->sql
  3.  
  4. use strict;
  5. use warnings;
  6. use DBI;
  7.  
  8. my $dbh = DBI->connect( 'DBI:mysql:database=test;host=localhost', 'root', 'pw' );
  9. my $dbh2 = DBI->connect( 'DBI:mysql:database=test;host=localhost', 'root', 'pw' );
  10.  
  11. DBI->visit_handles(
  12. sub {
  13. my ( $driver_handle, $info ) = @_;
  14.  
  15. if ($driver_handle->{Type} eq 'db') {
  16. $driver_handle->disconnect;
  17. }
  18.  
  19. return 1;
  20. }
  21. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement