Re: [PATCH 2/2] Use 'env' to find perl instead of fixed path
- From
- Eric Wong <e@80x24.org>
- Date
- Jan 13, 2017, 16:58 UTC
- Message-ID
- <20170113165819.GA6069@starla>
- 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