in reply to Re^3: GOTO or not GOTO
in thread GOTO or not GOTO

Well, neither $file nor $max_tries are globals. During the live time of the program the routine is called hundreds of times, and for each new call, I've a new file name, and 10 new tries. Besides, isn't using global variables a sin as bad as a goto?

But more importantly, the reason I wrote the code with the goto is that I need the $status afterwards. And I need to know whether the download eventually succeeded or not. Now, you can achieve all that by having uninteresting returning a list of two things (the status code, and whether it succeeded or not), but the code gets more complex that way.

I prefer the simplicity of the goto solution.