in reply to Re: GOTO or not GOTO
in thread GOTO or not GOTO
Personally, I use almost every tool* in the toolbox. Some more than others. I don't use goto often, but I do use it. For instance, in code like this:
I find that more attractive thanmy $max_tries = 10; GETSTORE: my $url = ask_url(); my $status = getstore($url, $file); goto GETSTORE if $status == 200 && !-s $file && --$max_tries > 0; ... do stuff ... return $status;
my $max_tries = 10; my $status; { my $url = ask_url(); $status = getstore($url, $file); redo if $status == 200 && !-s $file && --$max_tries > 0; } .. do stuff .. return $status
*Tools I never use that I can think of right now: formats, 1-arg open, study, and /o.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: GOTO or not GOTO
by apl (Monsignor) on Jan 27, 2009 at 12:08 UTC | |
by JavaFan (Canon) on Jan 27, 2009 at 12:16 UTC | |
|
Re^3: GOTO or not GOTO
by GrandFather (Saint) on Jan 27, 2009 at 21:21 UTC | |
by JavaFan (Canon) on Jan 27, 2009 at 22:17 UTC |