On Thu, Jun 22, 2006 at 03:07:32AM -0500, Charles K. Clarkson wrote: > > : OK, so here is the task. The first row I want to turn into > : variable names. Machine, PurgeSuccess, etc. > > You probably don't want to do that. You may end up needing > symbolic references to access those variables. Using symbolic > references is frowned on. Another approach might use a hash which > has keys that match the column names. The values associated with > those keys would reference arrays of values from all the records.
I must be missing something. Please explain the sentence "You may end up needing symbolic references to access those variables." > > : Then with that removed the real work happens. The script would > : then request which variables I would like to sort on or find > : records (rows) that contain the "matches" specified. > > Are you going to rewrite the script for each different record > search? How often will different searches be needed? Who decides > the need for new searches (you, the boss, other programmers, users, > etc.)? Why would he need to rewrite the script? Why couldn't it just loop through input data to (for instance) create an array containing each row, starting with the column headings row, then shift from each array to name new arrays from the column headings row and populate it in order from the other rows? I'm not saying that's necessarily the best way to do it, but it seems like a reasonable example of how the script could just dynamically handle different data from each run if need be without having to rewrite it each time. Some search functions could be created that simply take input that allows for search terms to be specified when the script is run. Voila, it works. Did I misunderstand your point? Of course, this seems like a lot of unnecessary work, since it basically involves writing one's own simple DBMS query system, but it would seem to suit the OP's requirements. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] "The measure on a man's real character is what he would do if he knew he would never be found out." - Thomas McCauley -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>