garyj has asked for the wisdom of the Perl Monks concerning the following question:

Just to clear up my previous post, I think I've got a handle on converting/importing the data from my flat file DB to MySQL. My question is, what changes do I need to make to my Perl script so that it connects to and reads/writes to MySQL rather than the flatfile? 2 parts:

1. Setup/config -- I know there's a:

use mysql;

statement, but what else do I need?


2. Declaring/calling/reading/writing values -- in my flat file, I use simple commands such as:

$config{'regdir'} = 'reg';
my ($title, $reserve, $inc, $desc)...
if ($password,$email,$add1,$add2)...
print $config{'header'};

Is the format the same for interacting with MySQL values?

Thanks.

Replies are listed 'Best First'.
Re: convert flat file to mysql -- again
by FoxtrotUniform (Prior) on Jan 16, 2002 at 01:46 UTC

    Rather than mess around with a MySQL-specific interface, I suggest you read up on DBI.

    --
    :wq
Re: convert flat file to mysql -- again
by mkmcconn (Chaplain) on Jan 16, 2002 at 01:47 UTC
    I need to make to my Perl script so that it connects to and reads/writes to MySQL rather than the flatfile? -- garyj

    You are looking for the documentation on DBI.
    Be sure to find and read the book Programming the Perl DBI.
    mkmcconn
    Also find the DBI documentation for MySQL modules