All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Pat Pannuto <pat.pannuto@gmail.com>,
	Junio C Hamano <gitster@pobox.com>, Johannes Sixt <j6t@kdbg.org>,
	git@vger.kernel.org
Subject: Re: [PATCH 2/2] Use 'env' to find perl instead of fixed path
Date: Fri, 13 Jan 2017 16:58:19 +0000	[thread overview]
Message-ID: <20170113165819.GA6069@starla> (raw)
In-Reply-To: <alpine.DEB.2.20.1701131626160.3469@virtualbox>

Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> I guess I do not understand, still, what the difference is between using
> -w and adding `use warnings` *very early* in the script... Could you give
> an example where it makes a difference?

"use warnings" won't leak across files/modules.  In the following
example, only the "useless use of join or string in void context"
from void.perl gets shown w/o -w.  The VoidExample.pm warning
can get lost.

----- VoidExample.pm ------
package VoidExample;
use strict;
# use warnings; # uncomment to trigger warning on next line:
join('', qw(a b c));

1;
------ void.perl ------
#!/usr/bin/perl
use strict;
use warnings;
use VoidExample;

join('', qw(a b c)); # warns
----------8<----------

$ perl -I . void.perl    # 1 warning
$ perl -w -I . void.perl # 2 warnings

  reply	other threads:[~2017-01-13 16:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12  5:51 [PATCH 0/2] Use env for all perl invocations Pat Pannuto
2017-01-12  5:51 ` [PATCH 1/2] Convert all 'perl -w' to 'perl' + 'use warnings;' Pat Pannuto
2017-01-12  5:51 ` [PATCH 2/2] Use 'env' to find perl instead of fixed path Pat Pannuto
2017-01-12  6:27   ` Johannes Sixt
2017-01-12  7:17     ` Pat Pannuto
2017-01-12 10:21       ` Johannes Schindelin
2017-01-12 20:40         ` Junio C Hamano
2017-01-12 21:01           ` Pat Pannuto
2017-01-12 21:49             ` Junio C Hamano
2017-01-13  2:48             ` Eric Wong
2017-01-13 15:27               ` Johannes Schindelin
2017-01-13 16:58                 ` Eric Wong [this message]
2017-01-13 17:13                   ` Johannes Schindelin
2017-01-13 18:27               ` Junio C Hamano
2017-01-13 18:52                 ` Eric Wong
2017-01-13 20:01                   ` Junio C Hamano
2017-01-13 21:39                     ` Eric Wong
2017-01-14  7:54                   ` Jeff King
2017-01-14 10:31                     ` Eric Wong
2017-01-14 21:57                       ` brian m. carlson
2017-01-13 15:21             ` Johannes Schindelin
2017-01-12  6:21 ` [PATCH 0/2] Use env for all perl invocations Junio C Hamano
2017-01-12  7:13   ` Pat Pannuto
2017-01-12  8:21     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170113165819.GA6069@starla \
    --to=e@80x24.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=pat.pannuto@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.