Skip to content

Instantly share code, notes, and snippets.

Last active April 2, 2019 05:07
What would you like to do?
use DBI;
my $host="";
my $port="3306";
my $user="ted";
my $pwd="ted";
my $wait;
my @dbhs;
my ($no_cons,$wait) = @ARGV;
if (not defined $no_cons) {
die "Need number of connections to try!\n ./$0 <no of db connectons> [time to sleep]\n";
if (not defined $wait) {
foreach my $i (1..$no_cons) {
my $dbh = DBI->connect("dbi:mysql:test;host=$host;port=$port", $user, $pwd);
next unless $dbh;
push @dbhs, $dbh;
foreach (@dbhs) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment