5 minimums for any perl script?

Mike Whitaker mike at altrion.org
Mon Jan 30 16:36:12 GMT 2012


On 30 Jan 2012, at 16:28, Mark Fowler wrote:

> On Sun, Jan 29, 2012 at 11:11 PM, Damian Conway <damian at conway.org> wrote:
> 
>> 3. Strictures: Always 'use strict' (and 'use warnings' during development) and
>>   explicitly state your minimum Perl version requirement. (e.g. 'use v5.10')
>>   [Ch18: "Strictures", "Warnings"]
> 
> I'd point out that if you state a reasonably modern version of Perl
> you don't need to turn on strict, it's turned on for you.  If you use
> Moose (or several other modules out there) then warnings get turned on
> for you too.
> 
> At $work in our key codebase we find demanding all these strictures
> tiresome.  We instead have a standard line that you need to put this
> into your source:
> 
> use OurSecretProjectName::Strict;
> 
> (If you don't the test suite will fail and our build system will get
> angry with you.)  This module turns on a bunch of handy strictures:

....

You could perhaps add 

$ENV{PERL_UNICODE} = "AS";
use open qw/:encoding(UTF-8) :std/;
use warnings qw/FATAL utf8/;
use feature qw/unicode_strings/;

but that might be considered optimistic, depending on the state of your codebase!


More information about the london.pm mailing list