I'm sad to see that the author of this thread has been downvoted.. I'm speculating that the reason for this is the opinion by many that
goto is just plain wrong.
The truth is that goto is a tool in the perl arsenal that can be used for good and evil. If anyone here is writing code that isn't indented properly, or relies on side effects from operations, or indeed doesn't parenthesise their arithmetic and logical instructions to prevent unexpected order of evaluation then they, too, should be viewed with disdain from the goto purists.
At least the thread author made a good attempt to justify the reason for needing goto; indeed the author needn't have justified anything. Perl has a goto statement and thus that's reason enough to be allowed to use it.
As a final note, I don't remember the last time I used goto in Perl or C programming (thought I've used it liberally in assembler).
instructional comment: one way of avoiding goto is to create a while loop and, should you want to skip something, use the next statement within the loop.
In reply to Re: Go to?
by monarch
in thread Go to?
by Ronnie
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
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:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.