in reply to Parsing user input into CSV table
Why on earth would you want to store HTML pages in a CSV file? You don't plan on serving them up from this one CSV file, do you?
Well, I'd advise you to not use CSV and instead use DBI with a real relational database backend like MySQL or PostgreSQL... But I'm guessing you can't, because if you could, you'd already be doing that instead, right? :)
Ok, well, to mess around with CSV you'd want to use either Text::CSV (with an optional C backend) or DBI with DBD::CSV. Either one of them can handle any needed comma escaping for you. If you only have a handful of these pages, storing them separately on disk really is not a bad idea. If you have a lot of these pages, another better, faster, easier solution than CSV is storing the stuff in some big hash where each key is--I don't know--a page name or section name, and then each value is the corresponding HTML code. Then you serialize it, storing the hash itself to disk that way it can be quickly loaded in the future, using DB_File (my favorite) or some other DBM module (like MLDBM).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Parsing user input into CSV table
by lwicks (Friar) on Apr 14, 2004 at 11:29 UTC | |
by William G. Davis (Friar) on Apr 14, 2004 at 11:58 UTC | |
by lwicks (Friar) on Apr 14, 2004 at 12:23 UTC | |
by William G. Davis (Friar) on Apr 14, 2004 at 18:30 UTC | |
by lwicks (Friar) on Apr 14, 2004 at 12:58 UTC |