Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Prefer while() with an occasional redo {was Re: do/redo or for(;;): what's Kosher?}

by dave_aiello (Pilgrim)
on Jan 04, 2002 at 02:20 UTC ( #136120=note: print w/replies, xml ) Need Help??

in reply to do/redo or for(;;): what's Kosher?

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, update, 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.

Dave Aiello
Chatham Township Data Corporation

  • Comment on Prefer while() with an occasional redo {was Re: do/redo or for(;;): what's Kosher?}

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://136120]
[marto]: Eily you can't remote connect the physical device via USB ;)
[Corion]: Eily: Sure, that's what I do, but some things you need to do on the Android device directly, like when navigating the bootloader :-)
[Eily]: marto you just need a longer cable :P
[Corion]: marto: Yeah, but I'm somewhat wary of installing random USB drivers downloaded from , Google Drive or whatever, so Linux wins there due to there being no conflicts and me just having to edit one text file in the worst case, to add the USB vendor
[hippo]: Long USB cable FTW.
[Corion]: Eily: I've thought of that, but I don't like running long cables through the appartment because sooner or later I'll trip over it, pulling at least one device off its stand :)
[marto]: hmm, may have to patch CPAN::Meta to move from search.cpan to metacpan in the META.json/yml files
[Corion]: marto: Heh - it seems that they plan to keep the links alive for a long time. But still, I plan on moving PM to use/generate the new links
[Corion]: And I think it's better to generate links to the new world instead of keeping the older links alive by generating new versions of them ;)
[marto]: yeah, I guess it's supposed to be a permanent redirect, but better to make the move where possible

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2018-05-23 09:18 GMT
Find Nodes?
    Voting Booth?