Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

RE: RE: Number of times I've used goto in Perl

by buzzcutbuddha (Chaplain)
on Apr 19, 2000 at 22:20 UTC ( #8064=note: print w/replies, xml ) Need Help??

in reply to RE: Number of times I've used goto in Perl
in thread Number of times I've used goto in Perl

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..

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://8064]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2020-09-21 03:08 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (124 votes). Check out past polls.