Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by buzzcutbuddha (Chaplain)
on Apr 19, 2000 at 22:20 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-19 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found