| From: | David Steele <david(at)pgmasters(dot)net> |
|---|---|
| To: | Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
| Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: use strict in all Perl programs |
| Date: | 2017-01-06 14:13:43 |
| Message-ID: | 7ef59455-b607-eafb-5bbc-c99cbf3ecfc1@pgmasters.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 1/5/17 12:37 PM, Peter Eisentraut wrote:
> On 12/31/16 1:34 AM, Michael Paquier wrote:
>> On Sat, Dec 31, 2016 at 3:07 PM, Peter Eisentraut
>> <peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
>>> Here is a patch to add 'use strict' to all Perl programs (that I could
>>> find), or move it to the right place where it was already there. I
>>> think that is a pretty standard thing to do nowadays.
>
> committed that
>
>> What about adding as well "use warnings"? That's standard in all the TAP tests.
>
> 'use strict' can be statically checked using perl -c, but 'use warnings'
> is run-time behavior, so one would have to extensively test the involved
> programs. Some cursory checking already reveals that this is going to
> need to more investigation. So in principle yes, but maybe later.
With regard to warnings, I prefer to use:
use warnings FATAL => qw(all);
This transforms all warnings into errors rather than just printing a
message to stderr, which is very easy to miss among the other output.
--
-David
david(at)pgmasters(dot)net
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Paquier | 2017-01-06 14:18:15 | Re: use strict in all Perl programs |
| Previous Message | Robert Haas | 2017-01-06 14:11:59 | Re: UNDO and in-place update |