A few points:
- Everybody in this monastery should tell you that you should
use strict and
warnings.
- If that "$CGI-DIR" means anything serious, you should also have Taint checking. If it doesn't (as I strongly suspect and "-w" could have told you), what is it doing there?
- Using DBI, you should either checking for an error after "connect", or set {RaiseError => 1}.
- data in a datbase is seldom reduced to a single table. And even if it is, getting data from a table without a "WHERE" clause, can fetch you a million records for no sensible reason.
- I fail to see the logic behind assigning $a =$#row and then incrementing it. How about
while (my @row=fetchrow_array()) {
print join ",", @row;
print "\n";
}
- what is the point in clearing the screen, if you are sending the output to a file?
- "seperate" should be spelled "separate"
- you are assuming that the user knows SQL, since (s)he is supposed to enter
special options. What is the purpose of using this "utility" if I can do the same with an one-liner?
$ mysql -t -u user -p -e "SELECT blah,Blablah from my_table"
I could continue, but I think it's enough.
gmax