Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: RFC: Transactions.pm

by Juerd (Abbot)
on Apr 28, 2003 at 12:16 UTC ( [id://253660]=note: print w/replies, xml ) Need Help??


in reply to Re: RFC: Transactions.pm
in thread RFC: Transactions.pm

I would suggest you work with die instead though - that will work with nested transactions and require fewer hoop jumps. You can then also easily add some more error checking:

I don't like your goto LABEL idea at all, but I do like the idea of using die very much. It even makes sense! :)

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Replies are listed 'Best First'.
Re^3: RFC: Transactions.pm (same as goto)
by Aristotle (Chancellor) on Apr 28, 2003 at 12:21 UTC
    last is nothing but a glorified goto - esp the way your were using it.

    Makeshifts last the longest.

      last is nothing but a glorified goto

      But I still like it better. Loops, loop control operators, subroutines -- all glorified gotos, but I like the structured versions much better.

      Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

        You're using it to sail across scopes in this case. That's a true goto, even if you don't like calling the child by its name. There's a reason for the warning you had to shut up and that it doesn't happen with goto. And anyway, sometimes, there is good reason to use the.. "G word". Just like sometimes, there's reason to use symbolic references. Or to use global variables. None of them are bad practices in and of themselves; there are just very few situations that warrant their use. As they say about goto:
        The apprentice uses it without thinking.
        The journeyman avoids it without thinking.
        The master uses it thoughtfully.
        Of course, in this case, die presented a still cleaner option.

        Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-18 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found