I should have seen that right away. You are trying to connect to a mysql database with syntax for the DBI::CSV module. When using the mysql driver connect like this:
my $dsn = "DBI:mysql:database=your_db_name;host=your_hostname;";
my $dbh = DBI->connect($dsn,'your_db_username','your_db_password') or
+die "Couldn't connect to database";
So instead of "f_dir" use "database=" and make sure to put the host name. If you are trying to use a comma separated file somewhere on your system then you should use the CSV driver, just keep using the f_dir part and put "CSV" where you have "mysql".
Hope that helps
Chris