git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] Use 'env' to find perl instead of fixed path

From
EWEric 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

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 12 of 24 in “Use env for all perl invocations”
  1. 0/2 Use env for all perl invocationsPat Pannuto, Jan 12, 2017
  2. 1/2 Convert all 'perl -w' to 'perl' + 'use warnings;'Pat Pannuto, Jan 12, 2017
  3. 2/2 Use 'env' to find perl instead of fixed pathPat Pannuto, Jan 12, 2017
  4. Johannes SixtJan 12, 2017
  5. Pat PannutoJan 12, 2017
  6. Johannes SchindelinJan 12, 2017
  7. Junio C HamanoJan 12, 2017
  8. Pat PannutoJan 12, 2017
  9. Junio C HamanoJan 12, 2017
  10. Eric WongJan 13, 2017
  11. Johannes SchindelinJan 13, 2017
  12. Eric WongJan 13, 2017
  13. Johannes SchindelinJan 13, 2017
  14. Junio C HamanoJan 13, 2017
  15. Eric WongJan 13, 2017
  16. Junio C HamanoJan 13, 2017
  17. Eric WongJan 13, 2017
  18. Jeff KingJan 14, 2017
  19. Eric WongJan 14, 2017
  20. brian m. carlsonJan 14, 2017
  21. Johannes SchindelinJan 13, 2017
  22. Junio C HamanoJan 12, 2017
  23. Pat PannutoJan 12, 2017
  24. Junio C HamanoJan 12, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.