P is for Practical | |
PerlMonks |
Re: Perl/CGI Performance for a Shopping Cartby Spenser (Friar) |
on Aug 04, 2002 at 17:58 UTC ( [id://187514]=note: print w/replies, xml ) | Need Help?? |
I used to use Perl with flat database files because I thought it was the simplest and best way to go. Then I discovered mySQL--this reads like a laundry detergent commercial. Anyway, mySQL has worked out much better for me. It does take a bit of an effort to get started, but it's not too bad with the proper books and some patience. As for its performance compared to other databases, it ranks as high as Oracle these days, according to e-week.
Regarding your concerns about exporting to delimited text files, that's a breeze with mySQL and Perl and the Perl DBI module. As with everything else with Perl, there are many ways of doing it, but below is a simple overview of an export program. This export program is assuming that you've already set up a database and table in mySQL, of course.
This bit of code is a lot wordier than it needs to be and can be consolidated into few lines. However, when starting out I think its better to spread the code out to keep your sanity and to make learning and trouble-shooting easier. -SpenserThat's Spenser, with an "s" like the detective.
In Section
Seekers of Perl Wisdom
|
|