Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I have never used GOTO in Perl, but in Visual Basic, which I learned in school. There
it's used for error handling where you would say:
On Error Goto ErrHandler
and then construct an appropriate subroutine underneath the ErrHandler tag to handle the error.
I believe the reason that VB uses GOTO in that situation is because an error can
conceivably occur at anypoint, and you want to be able to catch it immediately, instead
of wrapping things in a TRY..EXCEPT model. But that type of unexpected error seems to me
more of a problem in an 'event driven' piece of code, and not so much the style with which
Perl is used. Plus I think that it is more difficult to use than other methods I have seen.
So I personally cannot see the value of GOTO in Perl, though I do not deny it's validity, or the
skills of anyone who uses it.
just my $0.02..

In reply to RE: RE: Number of times I've used goto in Perl by buzzcutbuddha
in thread Number of times I've used goto in Perl by vroom

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • 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, 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, 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (4)
    As of 2020-10-28 06:23 GMT
    Find Nodes?
      Voting Booth?
      My favourite web site is:

      Results (260 votes). Check out past polls.