hello
i am trying to use perl to connect to mysql
my perl script looks like this:
Code:
#!/usr/bin/perl
use warnings;
use DBI;
use strict;
my $database = "project";
my $driver = "DBI:mysql";
my $dbh = DBI->connect($driver:$database, "root", "") or die "cant connect to mysql";
$dbh->do("insert into Cards values ('10896' , '1100')");
$dbh->disconnect;
but when i run the script i get error saying:
Quote:
syntax error at ./testdbi.pl line 10, near "$driver:"
Execution of ./testdbi.pl aborted due to compilation errors.
|
please help me with this one
thanks