If there are 10 records with the final catalog number, I
can easily see naive code only printing one of them. | [reply] |
Hey Merlyn,
My code accepts two arguements: First and Last. It just goes through the database and when it finds the first, it starts a loop that prints and increments a counter until it reaches the last number. It then prints the footer and exits. Really simple, really bulky, really sloppy, and a pain in the rear end to update. Also, I'm reading in the entire file into an array each time I do this. The file is about 250k. Do you think that it is pushing it to do that? Is there any quicker, perhaps more memory efficient way to do it? I'd give you the code, but I really don't think it will do any good after explaining what I did above. Let me know. | [reply] |
There are a couple, but they all involve changing the format in which your data is stored. As others in this thread have mentioned, you can use DB_File and its ilk, or (my recommendation) an RDBMS like MySQL or Postgres (both available for the cost of a download, with plenty of online help). Perl's DBI interface is robust and mature, so you shouldn't have too much trouble making the transition. It can't hurt to know some SQL =)
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
| [reply] |