develooper Front page | perl.perl5.porters | Postings from June 2012

Re: [PATCH] Add "use strict" to lib/

Thread Previous | Thread Next
Aristotle Pagaltzis
June 15, 2012 05:43
Re: [PATCH] Add "use strict" to lib/
Message ID:
Hi Shlomi,

* Shlomi Fish <> [2012-06-14 10:20]:
> On Mon, 11 Jun 2012 13:17:21 +0200
> Richard Foley <> wrote:
> > A solution which would permit the patch (or one similar) might be to
> > make the "use strict" behaviour dependent on an option setting,
> > something like:
> >
> >     PERLDB_OPTS="useStrict=1" perl -d ...
> >
> > Just an idea.
> […] Furthermore, since the patch makes the code conform to the "use
> strict;" conventions, why not enable it and gain the advantages of
> Otherwise we will have strict-compliant code without "use
> strict;".

I figured after a moment of reflection that Richard meant using
PERLDB_OPTS to decide whether code the user typed at the prompt is
evaluated under strictures or not. (My first interpretation was that he
was proposing that users be able to choose whether itself has
strictures turned on. But that makes no sense whatsoever, and people
don’t usually talk utter nonsense; if they seem to then the mistake is
usually the recipient’s.)

Even so I don’t think that’s useful, due to the way the debugger works.
Each line gets eval’ed, i.e. has a lexical scope of its own, so any
lexicals declared on a line go out of scope immediately. One tends to
work with globals when typing code in the debugger.

If that weren’t all the case then giving the user the choice to turn on
strictures for their code would be useful. But as it is I think they
should just stay off same as they always have.

Aristotle Pagaltzis // <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About