From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 016371F452 for ; Wed, 5 Apr 2023 21:30:25 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=80x24.org header.i=@80x24.org header.a=rsa-sha256 header.s=selector1 header.b=PChPSmZh; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230114AbjDEVaW (ORCPT ); Wed, 5 Apr 2023 17:30:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjDEVaV (ORCPT ); Wed, 5 Apr 2023 17:30:21 -0400 Received: from dcvr.yhbt.net (dcvr.yhbt.net [173.255.242.215]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2B821FF6 for ; Wed, 5 Apr 2023 14:30:20 -0700 (PDT) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5F3311F452; Wed, 5 Apr 2023 21:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1680730220; bh=f9d1ZZxlTbC+BJGvqUFOR6OJ/tj1Ts9hljpctcvUQYc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PChPSmZh+e3SjTdDsa7yqZc1V1t/nGMLgx84jSiTZF9LJBP9AMFr6UFkXct+H+jOg 9bU0oYUvlgI8QTXP9aRRd60Dus7y2E2PITdIK8C+HsMmUlFEN/uMVh5URiFuU5eEeD VsWUuCRFki/IVsKiW9LakjUkIXr37ob84PIg8pqY= Date: Wed, 5 Apr 2023 21:30:20 +0000 From: Eric Wong To: Patrick Steinhardt Cc: git@vger.kernel.org Subject: Re: [PATCH] global: resolve Perl executable via PATH Message-ID: <20230405213020.M231170@dcvr> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Patrick Steinhardt wrote: > diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl > index 755a110bc4..3fe43b8968 100755 > --- a/Documentation/cmd-list.perl > +++ b/Documentation/cmd-list.perl > @@ -1,5 +1,6 @@ > -#!/usr/bin/perl -w > +#!/usr/bin/env perl > > +use warnings; Fwiw, adding `use warnings' only affects the current scope (package main), whereas `-w' affects the entire Perl process. I prefer `-w' since adding `use warnings' everywhere is annoyingly verbose and I only use 3rd-party code that's warning-clean. In *.t test scripts and stuff I intend to be overwritten in install scripts; I've been using `#!perl -w' as the shebang as a clear signal that it should be overwritten on install or or run via `$(PERL) FOO' in a Makefile. For personal scripts in ~/bin, I've been going shebang-less and having the following as the first two lines: eval 'exec perl -w -S $0 ${1+"$@"}' if 0; # running under some shell (Only tested GNU/Linux and FreeBSD, though). This (and `env perl') will fail if distros someday decide to start using `perl5' as the executable name. That said, I don't know if anything I've said above is appropriate for the git project aside from noting the difference between `-w' and `use warnings'.