You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a bit of testing (see commit dc33f2b), it turns out that the code:
use Fatal qw(:lexical open);
open(my$fd, '<', 'missing-file');
Thows an exception like "use autodie qw(open)" would have (in fact said exception is an autodie::exception). Using git bisect, I have determined this has happened since commit 54d2fbd, so this behaviour has been defacto standard since 2008. This leads to the question: If we separate autodie from Fatal (issue #60), how should "use Fatal qw(:lexical ...)" behave? I see the following options:
Keep existing behaviour by "promoting" it to "autodie" (i.e. make use "Fatal qw(:lexical ... );" basically the same as "use autodie qw(...);").
Have "use Fatal qw(:lexical ...);" throw "old-style" exceptions.
Remove support for ":lexical" in Fatal completely (possibly with a "grace period" filled with deprecation warnings).
Note that the "Fatal" POD does not mention the ":lexical" tag at all (but it used to do). I suspect this to be by intention as the documentation suggests Fatal to be deprecated in favor of autodie. This begs the question, is ":lexical" now just an implementation-detail that we can change at will?
@pjf: Any suggestions? Otherwise, I will probably go with 1. as it seems to be the "most backwards compatible" option, given the lifetime of this bug.
The text was updated successfully, but these errors were encountered:
I'd suggest either 1 or 3, both are relatively safe. '3' means that :lexical becomes a compile-time error, which means there's much less of there being surprises for our users, whereas '1' means nothing changes at all.
I'm not sure any code out there actually uses :lexical. It was very much there as a potential interface, which was obviously dropped in favour of the autodie pragma.
So either 1 or 3; if in doubt, I agree with 1, as it won't cause any problems no matter what crazy things our users have done. :)
After a bit of testing (see commit dc33f2b), it turns out that the code:
Thows an exception like "use autodie qw(open)" would have (in fact said exception is an autodie::exception). Using git bisect, I have determined this has happened since commit 54d2fbd, so this behaviour has been defacto standard since 2008. This leads to the question: If we separate autodie from Fatal (issue #60), how should "use Fatal qw(:lexical ...)" behave? I see the following options:
Note that the "Fatal" POD does not mention the ":lexical" tag at all (but it used to do). I suspect this to be by intention as the documentation suggests Fatal to be deprecated in favor of autodie. This begs the question, is ":lexical" now just an implementation-detail that we can change at will?
@pjf: Any suggestions? Otherwise, I will probably go with 1. as it seems to be the "most backwards compatible" option, given the lifetime of this bug.
The text was updated successfully, but these errors were encountered: