Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^6: Is this DBM::Deep behavior, or something with tie/bless? (ref)

by dragonchild (Archbishop)
on Feb 12, 2008 at 16:57 UTC ( #667615=note: print w/replies, xml ) Need Help??


in reply to Re^5: Is this DBM::Deep behavior, or something with tie/bless? (ref)
in thread Is this DBM::Deep behavior, or something with tie/bless?

A few thoughts:
  • Those isX() methods belong in Scalar::Util (or something similar). I have similar snippets in DBM::Deep itself for the exact same reason.
  • You need to localize $SIG{__DIE__} within those evals. In doing this for DBM::Deep, I found Test::More does things with die handlers that get tripped up with this.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Re^6: Is this DBM::Deep behavior, or something with tie/bless? (ref)

Replies are listed 'Best First'.
Re^7: Is this DBM::Deep behavior, or something with tie/bless? (eval)
by tye (Sage) on Feb 12, 2008 at 17:04 UTC

    Rather, $SIG{__DIE__} handlers need to detect that eval is in effect ($^S -- even though it still isn't perfect). $SIG{__DIE__} is (by far) the 'worse' magic and so needs to take the burden for "playing nice". "Simple" use of eval doesn't need to be made even more complicated. local( $@ ); is another safety measure that is missing from the simple examples. Quite the mess.

    - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://667615]
help
Chatterbox?
[Corion]: stevieb: Naah, I wouldn't delete versions from CPAN. Just up the version to 2.37 resp. 2.37.0 / 2.37.1 etc

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (15)
As of 2017-01-19 15:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (170 votes). Check out past polls.