I primarily do Perl / SQL integration for a living, so I am partial to the while
loop with an occasional redo
. A lot of my programs require a "belt and suspenders" approach to data integrity, so I will often test for previous existance of a row or foreign key relationships before doing insert
, or deletes
For example, occasionally, a program will receive data from someplace else and conclude that an update needs to be done. However, the database does not contain the row in question. In that case, we change some aspect of the data so that an insert will take place, and perform a redo. This is by far the most intuitive way to perform a task like this.
OTOH, I don't like the "eternal-block" construct that you describe very much, unless you label the block and put in extensive comments. Maybe I'm too focused on my typical application, but I don't see very many benefits to doing this.
Chatham Township Data Corporation
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||