What interface used in PERL to connect to database? How do you connect to database in Perl?



What interface used in PERL to connect to database? How do you connect to database in Perl?..

Answer / Subhash Kumar Singh

"The DBI (Database Interface) module is used in Perl to connect to a database. To connect to the database, you can use the following code: use DBI; my $dbh = DBI->connect("DBI:mysql:database=my_database;host=localhost", "username", "password"); This will connect to a MySQL database on localhost with the provided username and password."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More CGI Perl Interview Questions

you are required to replace a char in a string and store the number of replacements. How would you do that?

1 Answers  


How to open a directory in perl?

1 Answers  


Can inheritance be used in perl?

1 Answers  


What is a chomp() function in perl?

1 Answers  


What is perl unshift array function?

1 Answers  


Explain grooving and shortening of arrays and splicing of arrays?

1 Answers  


How to find out the version of PERL being installed on your LINUX machine.

4 Answers   Mind Tree,


How can you replace the characters from a string and save the number of replacements?

1 Answers  


How can memory be managed in Perl?

1 Answers  


When do you use perl programming?

1 Answers  


Why do you program in Perl?

4 Answers  


How would you replace a char in string and how do you store the number of replacements?

2 Answers  


Categories