PrePAN

Sign in to PrePAN

sane provide sane default pragmas

Good

Synopsis

use sane;

# is the same as:

use strict;
use warnings;
use utf8;
use feature (sprintf(":%vd", $^V));

Description

use strict; use warnings; use utf8; use feature (sprintf(":%vd", $^V));

is too long for perl mongers!

Comments

Is there the opposite of `use sane;'? `no sane;' or `use insane;'?
Nope, writing `no strict; no warnings; no utf8; no features;` is insane.
You can disable specific pragmas like `no strict 'refs';`
That's exactly insane ;)
It's not sane for me.
あ、だしちゃった…
So, how can it be actually `sane'?
How is this different (or better) than Common::Sense or Modern::Perl, etc?
@jeremiah
Did you read the code of common::sense and Modern::Perl?

You will find that using common::sense is too difficult unless you don't have common sense.

Modern::Perl doesn't import utf8 pragma and can't enable the 'unicode_strings' feature. (cf. perldoc of feature pragma)
Yes, this is good; I'll use it.
I'm not sure when the 'feature' pragma was first introduced, but according to the cpantesters matrix (http://matrix.cpantesters.org/?dist=sane+0.02) your module seems to have some issues before 5.10. Perhaps you need to set a requires in your Makefile.PL?
@me
s/difficult unless you/difficult if you/;

@tagg
Yay!

@mlawren
Thank you. I've just pushed fixed Makefile.PL on github. And I'll release new tarball tomorrow.

perldelta says "The feature pragma is also implicitly loaded when you require a minimal perl version (with the use VERSION construct) greater than, or equal to, 5.9.5." (http://perldoc.perl.org/perl5100delta.html#The-feature-pragma)
So I had to write `BEGIN { require 5.010 }` into makefile.pl (for minimal stable version)
This looks pretty close to "use common::sense" or "use Modern::Perl". Do we need yet another? If they are missing the features you need (e.g. use utf8), perhaps ask their maintainers to consider adding them?

Please sign up to post a review.