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

Re: RFC - Issue a warning "-np better written as -p"

Thread Previous | Thread Next
From:
Dan Book
Date:
June 17, 2021 06:50
Subject:
Re: RFC - Issue a warning "-np better written as -p"
Message ID:
CABMkAVVyw3SSKTqeHHAHbzcvaQn2CvrnqMDsnTi6Y1yQSeUv7w@mail.gmail.com
On Thu, Jun 17, 2021 at 2:22 AM Nicholas Clark <nick@ccl4.org> wrote:

> On Wed, Jun 16, 2021 at 11:36:39AM -0400, Dan Book wrote:
> > On Wed, Jun 16, 2021 at 4:51 AM Nicholas Clark <nick@ccl4.org> wrote:
> >
> > > https://github.com/Perl/perl5/issues/18641 becomes our next test RFC.
> > >
> >
> > I don't think it's particularly useful to warn about this. Nothing is
> > broken or potentially broken by specifying unnecessary switches. I would
> > suggest it could become an optional warning if and when we add support
> for
> > that, but this would only come up for oneliners which are not likely to
> go
> > to the effort of enabling optional warnings of any sort.
>
> I'm going to guess the same for one-liners - they likely won't invoke
> warnings. (The numbers from the Debian source searches suggest this)
>
> But it can't be an *optional* warning, because if it is going to warn, it
> needs to be enabled by '-w' on the command line, and I doubt that we're
> going to change '-w' to be "optional too", or however we do it. I'd assume
> that '-w' needs to keep meaning `use warnings`
>
>
> However, skimming the source search results suggests that it's mostly
> written as '-np'. And we document that '-p' overrides '-n', so this common
> ordering is consistent with actual behaviour.
>
> Maybe we should warn on '-pn' - ie order matters too - '-n' flag ignored.
>

If this actually results in `-p` behavior being overridden, then I agree
this specific ordering should cause a warning.

-Dan

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