According to what you are all saying, I probably will stick with getting it strait from the database. The other way I mentioned seems like it might actually be simpler, but I don't really know.
Preformence isn't really much of a concern for me. I was wondering also about which would be a better way to write my perl scripts. Here's some basic psuedo-code of what I have, and what I was thinking.
Current Process:
The view function of the script is called whenever the user visits the page.
The add/change data function of the script is only used by me.
view function {
connect_to_databse;
get_data;
format_data;
print;
disconnect_from_databsse;
} end view function
add (or change) data function {
get_submitted_data_from_form;
connect_to_database;
insert_data; (change_data;)
disconnect_from_database;
}
Possible replacement:
The entire script is only used by me, and the formatted txt file is grabbed by the user.
add/change data function {
get_submitted_data;
connect_to_database;
change_data;
get_all_data;
format_data;
save_in_txt_file;
disconnect_from_database;
}
Final suggestions?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.