On Wed, Sep 2, 2015 at 3:51 AM, Robert Strahl via perl6-users <
perl6-users@perl.org> wrote:

> I don't understand why some people feel so strongly that one-liners should
> be strict. That would undermine what a one-liner is — a quick way to get
> something done. I use perl5 one-liners very frequently for text processing,
> especially when stringing / piping together shell code. When I need to
> re-use the code, then I put it into a script and make it strict and
> bulletproof in other ways. Declaring variables in the one-liner context
> makes no sense.
> Since the two sides of this debate will never see eye-to-eye on this, all
> I can ask is that there be an easy and top-level way to set the default
> strict or not_strict for one-liners. Perhaps a shell variable
> PERL6-ONE-LINERS-STRICT=<0|1>; , or -e -E as mentioned.

First, my apologies for not getting involved earlier, this discussion flew
below my radar.

I'm completely in agreement with your arguments, Robert, I don't see the
use for requiring strict for the command line by default.

Strict mode cripples Perl 6's usability for one-off scripts*.

Specifying -Mstrict or -e 'use strict;' is good enough for those cases when
you really need to be strict in one-off scripts.

Specifying -E instead of -e to do the same seems a good way to confuse
people, considering the apparent similarity to the Perl 5 options. There
are only so many context switches a human brain can handle.

* I don't like calling them one-liners, as they can be quite complex before
evolving into file-based scripts.


Reply via email to