| От | David E. Wheeler |
|---|---|
| Тема | Re: warning handling in Perl scripts |
| Дата | |
| Msg-id | 21E79B35-2B46-4C92-9269-2971FB84F5FD@justatheory.com обсуждение |
| Ответ на | Re: warning handling in Perl scripts (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: warning handling in Perl scripts
|
| Список | pgsql-hackers |
On Jun 25, 2012, at 3:35 PM, Tom Lane wrote:
> +1 for the concept of turning warnings into errors, but is that really
> the cleanest, most idiomatic way to do so in Perl? Sheesh.
It’s the most backward-compatible, but the most idiomatic way to do it lexically is:
use warnings 'FATAL';
However, that works only for the current lexical scope. If there are warnings in the code you are calling from the
currentscope, the use of `local $SIG{__WARN__}` is required.
HTH,
David
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера