Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^5: Goto-labels for exception handling?

by RonW (Parson)
on May 15, 2018 at 19:26 UTC ( #1214580=note: print w/replies, xml ) Need Help??

in reply to Re^4: Goto-labels for exception handling?
in thread Goto-labels for exception handling?

Personally, when it helps readability and maintainability, I have used goto - just very very rarely. Usually, where goto might be used, last can be used, though sometimes requires also using an error variable.

As for "missing receptors", the only idea I have come up with is to make sure that all "goto" labels are unique. A major problem doing this is finding all the labels. (Maybe Perl::Critic can help with this.) Pre- or post- fixing labels can reduce collisions, but this is very tedious extra work. Maybe defining Pluggable keywords, for example, throw and catch could automate this.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2019-04-19 06:19 GMT
Find Nodes?
    Voting Booth?
    I am most likely to install a new module from CPAN if:

    Results (106 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!