I'm using Windows 98. I've perl 5.8 installed in C:\perl5.8, mysql installed in C\mysql (the default directory) and apache installed in C:\apahce2.
I create my databases via mysql command line. I don't know how others do it but I've pre-made sql statements saved in C:\myslq\bin. I then start mysql and at the command line:
mysql> source name_of_sql_file
( 'source' is the command to input the saved sql statements )
An example of such a file is as follows;
DROP TABLE IF EXISTS levels;
CREATE TABLE levels (
level_id CHAR(1)NOT NULL PRIMARY KEY,
level VARCHAR(15) NOT NULL,
);
I do the same with insert statements. That saves the trouble of typing out the statements at the mysql prompt.
In my perl scripts, I've the shebang line as follows:
#!C:/perl5.8/bin/perl.exe
Used with apache, this tells the script where to look for the perl interpreter. Provided you've configured the apache config file, perl scripts will execute when called from the browser e.g.
http://127.0.0.1/myscript.pl
These are the things in you need to look out for in the apache config file:
1) # DocumentRoot "C:/apache/Apache2/htdocs"
-> Change this to your web directory
2) #<Directory />
# Options Indexes FollowSymLinks
# AllowOverride None
#</Directory>
3) #<Directory "C:/apache/Apache2/htdocs">
-> Change this to your web directory
4) #Options Indexes FollowSymLinks
-> Options Indexes FollowSymLinks MultiViews ExecCGI Includes
5) AllowOverride None
-> Change to AllowOverride All
6) #AddHandler cgi-script .cgi
-> Change to AddHandler cgi-script .pl
( To allow perl scripts to run with .pl extension)
Assuming both mysql and apache are running, you establish a connection to the database via the perl script (the variables you need to know: the database driver, the username, password, and the name of the database). There are lots of tutorials on the web on how to do that.
The databases you've created reside in C:\mysql\data. You need not worry about how to find the databases. Once a connection via the perl script is established, your database will be automatically accessible to your program.
It may be a bit messy the way I've described but I hope it'll give you some idea.