# from Michael G Schwern
# on Monday 26 February 2007 09:20 pm:
>>breaking broken code is easier than
>> accounting for ignorance with the unfortunate side-effect that the
>> user learns something. The ignorance goes away and balance is
>> restored.
>
>Again, you're assuming the "user" here to be the author of the naughty
> code in question. Or that you can write code which knows what's
> naughty and what's intended. I say that most of the time such
> vigilante coding will only bother 3rd parties who use your vigilante
> module in conjunction with someone else's code.
There's nothing vigilante about writing code that assumes other code
will behave properly. If I were going to put something on CPAN that
messed with __DIE__ hooks, it would only be an audit module. I'm
certainly not going to put delete($SIG{__DIE__}) at the beginning of
every module either (take a joke -- it saves typing.) I will, however,
refuse to say "local $SIG{__DIE__}" inside of every eval just because
"*maybe* *somebody* did *something* wrong *somewhere*." The user has
every right to shoot themselves in the foot however they see fit.
> Your CPAN module is
> going to break other CPAN modules and the poor sap using them who
> didn't write any of it is going to have no idea why.
You're placing the blame in the wrong place. Modules which rely on a
poorly-implemented $SIG{__DIE__} are going to break anyway. I'm just
saying we should all leave the slack in the rope and not walk on
eggshells. If the "poor sap" (though I tend to give Perl programmers
more credit than that) wants to send me an e-mail questioning why I
would be so bold as to use eval, I'll happily diagnose the problem and
send them in the right direction.
--Eric
--
"Insert random misquote here"
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------