I am currently trying to create a prompt for a perl script to have the user enter their MySQL username and password before executing the code. That part is easy enough but what I want it to do is loop if the DBI returns an accessed denied error thus asking the user to reinput the information. Any suggestions would be greatly appreciated. Here is the begging part of the code
my $database = ""; my $platform = "mysql"; my $host = "5.214.214.121"; my $port = "3306"; print "Enter User Name\n"; my $user = <>; chomp $user; print "Enter Password\n"; my $pw = <>; chomp $pw; $dsn = "dbi:mysql:$database:5.214.214.121:3306"; $dbh = DBI->connect($dsn, $user, $pw, { RaiseError => 0, Print +Error => 1 });
In reply to DBI user input question by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |