> On Thu, 26 May 2005, Alex Brelsfoard wrote: > >> Picture a web form that is some sort of a survey. When that survey is >> submit the perl script writes out the answers onto a file. That file >> is tab delimited. > > Stop right there, doctor, I think we've found the problem. >
Actually the problem exists BEFORE this part. You see, the script never receives the field name and therefore does NOTHING with. It only knows to do with what it is given. So my storage format (not decided be me for the record) is not the issue. Think of it this way: My perl script reads in all the data sent to it, creating a list of fields. Then I spit out the values associated with those fields (who cares how). But when a checkbox is NOT filled in, that field name is NOT sent to my script. So the list of fields is one field shorter than it should be. And with dynamic or otherwise changing field names..... yeah I'm screwed. A little clearer? --Alex > If you used a more robust storage format, this problem would go away, > right? For simple, you could just do something like the Windows INI > format, which is just blocks of key/value pairs, and can be driven from > Perl -- provided you don't want to just roll your own code -- using a > module like Config::IniFiles or Config::IniHash: > > <http://search.cpan.org/~gcarls/Config-IniFiles/IniFiles.pm> > <http://search.cpan.org/~jenda/Config-IniHash/IniHash.pm> > > Or you could get fancy and use a tied hash, a BDB database, a SQLite > database, or a proper database server. > > The key thing to keep in mind is that you're currently describing a > brittle format for maintaining lists of key/value pairs, but there's > lots of other ways to go about this. > > >> In other words, not terribly fun. > > Thankfully, these calamities are easily preventable :-) > > > > -- > Chris Devers > _______________________________________________ Boston-pm mailing list [email protected] http://mail.pm.org/mailman/listinfo/boston-pm

