Jan 17, 2001, 10:22 AM
Post #2 of 2
I am new to Perl as well but have programmed in VB, ADA, C++, and now Perl (for about a month).
Ah...another flatfile-head (no offense...me too). I was (sorta) in the same boat. Now this is not the only way, just the way I seem to like...
There are two ways to attack this...You can load the data into either a multidimensional array or a hash. I, myself, have opted for using arrays for my data.
As for the searching, I am in the process of writting a open-source generic flatfile -> html table script that allows for a number of factors like searching for a value and searching for a value in a specific field. It then outputs those records that match. You can use it either with a template (uses the GREP command to do search and replace) or as a SSI call from within a existing page (by omitting the &template parameter).
It still needs a little work plus I need to standardize some things but feel free to look it over. It works great on NT but I am fixing some UNIX issues. If you see something that can be improved on, let me know.
http://www.shrum.net/db_table.pl <-- as of Jan 9th
I should have it done within a week or 2 (school starts up next week) but if your in a rush you can get the general idea from what I am doing.
As for the printing of specific pages...hmmm...you can do it but you would need to specify a range...sorta like search pages allow you to see 10 records a page but gives you the option of jumping to page 4 (records 40-49). Sorta like:
I will most likely implement something like this in my script later in the week. As for doing it at the same time...maybe someone else knows (short of hard coding a page and putting 2 #exec lines in them but that's not very practical).
Hope this helps. This forum has been good to me so I share the wealth (of knowledge).