develooper Front page | perl.perl5.porters | Postings from June 2008

Re: autodie.pm design questions

From:
Roland Giersig
Date:
June 2, 2008 09:43
Subject:
Re: autodie.pm design questions
Message ID:
48442313.5060903@cpan.org
Abigail wrote:
> What's the point of changing the meaning of something, and then,
> when someone uses the new meaning, give a warning the meaning was
> changed?

Good point.  Would it be better to deprecate Fatal (with a warning) and 
tell people to use Fatal::Globally and Fatal::Locally instead?  OK, 
forget about that, let's just call ist autodie and be done with it, 
given that we just can remove Fatal from the docs and have autodie take 
its place.

 > Who's going to benefit from that?

I was thinking about adding dwimmage to Fatal to "fix" the error-prone 
behaviour.  If that is feasible, everybody would benefit from it.

> How often do you see people posting code where they used Fatal
> inside a block, wrongly assuming it would not raise a fatal error outside
> of the block?

I don't know, do you have any statistics?

What are the consequences of silently making Fatal work on a local scope 
instead of globally? It would make code that before died with a Fatal 
error message now either die at a different location due to some 
undefinedness (which IMHO is acceptable) or just give a warning and 
produce wrong results (which in some cases is not acceptable).

Is there a way to see if the Fatalized statement is followed by error 
handling code? Am I insane to ask such a question? I think I need a beer...

Cheers, Roland







nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About