in reply to Go to?
So with that in mind....Examine what is said, not who speaks -- Silence betokens consent
"I've never used a goto" indicates a lack of experience not knowledge.
Yes, perhaps it does. However, I think you misunderstand me. I actually said "in that time I've never used a goto" - referrring to the length of time I've been using Perl for.
Sure I've used goto's in the past. In fact, the BASIC programs I was writing in 1978 would have been littered with them. But this is 2006, and this is Perl. And thankfully, Perl provides us with a rich set of loop control and program flow features which help us to write more structured programs, and hence avoid bouncing all over the place with goto's.
Unlike some people I know why using goto is frowned upon
Good for you!
And which people would that be, btw?
doesn't alter the fact that there are times and places where it's use is required! This is one such case!
With respect, I disagree. I've already given you a working example of how you can make do without one. And monarch, cdarke and Roy Johnson have also given you pointers to methods that can avoid it.
please respond to the question not demonstrate petty prejudice!
Your original question asked if there was a "go to" in Perl. I told you that
there was, and I gave you links to the appropriate documentation.
How is this not responding to your question?
is to use a goto what will you do? Say to the boss it can't be done because it offends me?
In such a situation, I would use a goto. I'm not quite sure where you got the idea that the use of goto offends me. All I said was "looking to use a goto is generally a sign that your program logic is flawed". And, it generally is. As I've been learning to use Perl, there have been several occassions where I have found myself thinking "mmm, I need to use a goto here". And without exception - after doing some reading or seeking advice from others - I have found that it wasn't necessary at all.
Cheers,
Darren :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Go to?
by dragonchild (Archbishop) on Apr 11, 2006 at 13:23 UTC | |
by McDarren (Abbot) on Apr 11, 2006 at 14:15 UTC | |
by dragonchild (Archbishop) on Apr 11, 2006 at 14:54 UTC | |
by Limbic~Region (Chancellor) on Apr 11, 2006 at 15:23 UTC | |
by tilly (Archbishop) on Apr 20, 2006 at 04:32 UTC | |
by tilly (Archbishop) on Apr 20, 2006 at 04:15 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |