Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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


Comment on RE: RE: Number of times I've used goto in Perl
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-12-25 13:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls