Connecting to database in perl? : I am beginner at perl programming. And I am trying to connect to mysql database. I found this script in other website and i am trying to use it in my pc and hosting. but it dosn't show any output. Please have a look at this code.I am running perl at xampp.

    #!C:\xampp\perl\bin\perl.exe

    print "Content-type: text/html\n\n";
    use DBI;
    use strict;
    my $driver = "localhost"; 
    my $database = "data";
    my $dsn = "DBI:$driver:database = $database";
    my $userid = "root";
    my $password = "";

    my $dbh = DBI->connect($dsn, $userid, $password ) or die $DBI::errstr;

I am using same database with php.




