in reply to how to know if a databse exists before i delete it?

Assuming (from your example) that you are talking about MySQL, there are two ways:

# easy $db->do("DROP DATABASE IF EXISTS nikos_db"); # difficult my $dbs = $db->selectcol_arrayref("show databases") or die("can't get the db list\n"); if (grep {$_ eq 'nikos_db'} @$dbs) { $db->do("DROP DATABASE nikos_db"); }

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.