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

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

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
June 15, 2012 05:43
Subject:
Re: [PATCH] Add "use strict" to lib/perl5db.pl
Message ID:
20120615124334.GD9757@fernweh
Hi Shlomi,

* Shlomi Fish <shlomif@shlomifish.org> [2012-06-14 10:20]:
> On Mon, 11 Jun 2012 13:17:21 +0200
> Richard Foley <richard.foley@rfi.net> 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
> strict.pm? 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 perl5db.pl 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.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

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