-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set $^W default to off. #427
Conversation
$^W forces warnings on for everything. The entire perl5 VM. Not just your code. This means that code that was intentionally written without 'use warnings;' can end up having them forced on. If you want to actually import warnings into a module when somebody does 'use Dancer', warnings->import::into($module) will work. |
I'd prefer Dancer2 be opinionated enough that when you These days Dancer1 does that and has a My two cents: @ambs - I'm happy to work on an alternate pull request since I'm dissing this one..! |
@veryrusty, this was a quick hack to answer to @shadowcat-mst on IRC. I am happy with different approaches. Please go ahead :-) |
On Sat, Sep 07, 2013 at 05:40:27AM -0700, Alberto Simões wrote:
I would -love- to see the $^W thing die in a -ing fire. Covered in bees. I would also love to see warnings imported along with strict (given you're But mostly I just wanted us to stop screwing people by turning it on, and If you're willing to put together a PR that fixes this properly, I will be Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue http://shadowcat.co.uk/blog/matt-s-trout/ http://twitter.com/shadowcat_mst/ Email me now on mst (at) shadowcat.co.uk and let's chat about how our CPAN |
…setting. Use warnings->import when importing Dancer2 to ensure any code using it has the warnings pragma enabled (just like strict and utf8). L<perllexwarn> states ".. using $^W to either disable or enable blocks of code is fundamentally flawed.". Also see Matt Trout's comments in PerlDancer#427. Remove the import_config setting and its trigger that mucks with $^W and purge it from the POD. If anyone really wants to set $^W, they can add it to their app or psgi file and be in control of the results.
I agree with the decision to remove global warnings, but we should still import warnings to the caller, per @shadowcat-mst's example. It seems @veryrusty addressed it in #443 after the fruitful discussion this PR has provided, so I'm closing it. Thanks everyone. :) |
@veryrusty++ as usual. |
Requested by Matt Trout. Probably he can argue here why, or even suggest further changes.