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.


On Tue, Sep 1, 2015 at 1:24 AM, Matija Papec <mpapec2...@yandex.com> wrote:

> This is actually bad decision. If I'm concerned with *my* one-liner I'll
> use -Mstrict and all would be great.
> On the other hand, most of the time one-liners use one or two variables.
> Now, how difficult is for human to track these two?
>
> ps. -M-strict (no strict) is not valid command line option, so perl6 -e
> 'no strict; ..' is to my knowledge only option to disable it.
>
>
>
> 28.08.2015, 17:48, "Carl Mäsak" <cma...@gmail.com>:
> > Moritz (>>), Tux (>):
> >>>  I could continue with other Perl 5 deficiencies (no strict by default,
> >>
> >>  Using strict *STILL* is not enabled by default for perl6
> >>  one-liners either:
> >>
> >>  $ perl6 -e'my Int $this = 1; $thıs++; say $this;'
> >>  1
> >>  $ perl6 -Mstrict -e'my Int $this = 1; $thıs++; say $this;'
> >>  ===SORRY!=== Error while compiling -e
> >>  Variable '$thıs' is not declared. Did you mean '$this'?
> >>  at -e:1
> >>  ------> my Int $this = 1; ⏏$thıs++; say $this;
> >>
> >>  That, IMHO, is a huge deficiency!
> >>
> >>>  lack of easy threading, too many globals, obscure regex syntax), but
> the
> >>>  individual problems aren't the point. My main point is that large
> parts
> >>>  of Perl 5 are still stuck in the past, with no good way forward.
> >
> > Good news! I just pushed a change (with backing from other core
> > developers) that makes -e strict by default!
> >
> > commit 5fb81fffa90f90515e663a21987cff484e8260b8
> > Author: Carl Masak <cma...@gmail.com>
> > Date: Fri Aug 28 17:45:25 2015 +0200
> >
> >     strict is now on by default, even for -e
> >
> >     This should make (most of) p6u happy.
> >
> > Enjoy! :)
> >
> > // Carl
>

Reply via email to