develooper Front page | perl.perl5.porters | Postings from December 2007

Re: 5.11 (or 12) and strict

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
December 26, 2007 23:17
Subject:
Re: 5.11 (or 12) and strict
Message ID:
47735160.5060008@pobox.com
Sean O'Rourke wrote:
> Steffen Mueller <l2ot9pa02@sneakemail.com> writes:
>> If you write enough code to make importing optional features
>> worthwhile, odds are very high you'd be importing "strict"
>> anyway.
> 
> I'm not a p5p regular or a Perl core developer, so you definitely
> can, probably will, and possibly should ignore me.
> 
> That being said, the above quote basically says "if you want to
> use some desirable feature (like given/when) that is in Perl >
> 5.10, you must accept this other feature (strictures) P5P deems
> healthy," which seems strangely authoritarian.

That's how "use 5.XXX" works with regard to feature.  You get everything or
nothing.  Somebody has to decide what "everything" is.  Besides, this is more
making the defaults fall in line with existing good practice than dictating.

And there are plenty of ways to turn individual features on and off as simple
as "use 5.012; no strict;".

You can turn your argument on it's head.  If you want to get all the modern
features of Perl 5.12 why must we continue to turn some of them on
individually?  If most folks are writing out "use strict" why should a handful
who don't want that dictate the defaults?  Or why should a decision made 20
years ago and enshrined in the stone of compatibility that EVEN THE GUY WHO
MADE THE DECISION agrees isn't a good idea anymore [1] dictate how we code now?

I don't want to just dump it all on Larry, as convenient as it is, but we'd
just be following the rule "Larry is always right, even when he is wrong". :)


> People who want
> all the code on their own systems to run with strict can set
> PERL5OPT in /etc/profile.  Those who want all the code on other
> people's systems to do so are mistaken.

Perhaps you're missing the lexical effect of "use 5.xxx" and feature.  Only
the author's own code will be effected.  It's not some system-wide switch that
infects your whole install base.

Also -Mstrict has no effect beyond the main program.  strict is lexical.  And
reaching into to other people's code to fiddle about is a Bad Idea.


[1] See Apocalypse 1's discussion of RFC 16 and notes on strict in Synopsis 1.
http://dev.perl.org/perl6/doc/design/apo/A01.html
http://perlcabal.org/syn/S01.html

-- 
If at first you don't succeed--you fail.
	-- "Portal" demo

Thread Previous | Thread Next


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