in reply to perl cgi and flat textfile

I have found that error prone programming causes processing to be inherently error prone. My experience is that the internals of your programming (Code, Source Files, and Output) should have no errors or inconsistencies. Sometimes you might get an error from external sources such as running out of disk space or memory. Unless your program causes theses errors then there is nothing you can really do about that. It is your job as a programmer to insure that your code is as fool proof as you can make it.

I have found that if I can, I like to cerate my own Perl Database out of a text file. I guess it comes from being lazy (hey, a Perl hacker is suppose to be lazy) because connecting to a database such as Oracle, MySQL, MSAccess cause more overhead for my scripts. You would need to anticipate more things that might go wrong such as connection time-out, table unavailability and the like. If it is just a text file somewhere, then you can control the file more completely through Perl (If you need to add a table, just create a new file or what ever.) By the same token though there are times where you would need to use a managed database such as many other users and applications that need to access the data in many different ways. If you are having problems with your coding you can look at some of the many DBI modules or look in the Camel and Panther books where there are examples and explanations on how to make a working database out of a file.

Here is an example where I just write an Excel spreadsheet (Untested Sample code):
use Spreadsheet::WriteExcel; my $julian = 'Header'; my $ttime = '1208011500'; my $workbook = Spreadsheet::WriteExcel->new("$julian.xls"); $worksheet = $workbook->addworksheet("Missing Stores $julian"); $format = $workbook->addformat(); $worksheet->set_column(0, 0, 12); $format->set_align('center'); $format->set_bold(1); $worksheet->write(0, 0, "Julian/Time", $format); $worksheet->write(0, 1, "Store", $format); $format->set_bold(0); $worksheet->write(1, 0, "$julian/$ttime", $format); my $i = 1; my $n = 0; until ( $n == $missxn ){ $worksheet->write($i, 1, "@No_file_ssc[$n]", $format); $i++; $n++; }
@No_file_ssc is declaired else where in the script.

Sparky