Re: warning handling in Perl scripts

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: warning handling in Perl scripts
Дата
Msg-id 23709.1340640475@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: warning handling in Perl scripts  ("David E. Wheeler" <david@justatheory.com>)
Ответы Re: warning handling in Perl scripts  (Ryan Kelly <rpkelly22@gmail.com>)
Список pgsql-hackers
"David E. Wheeler" <david@justatheory.com> writes:
> Hrm, I think that `use warnings 'FATAL';` might only work for core warnings. Which is annoying. I missed what was
warningup-thread, but the most foolproof way to make all warnings fatal is the originally suggested
 

>   local $SIG{__WARN__} = sub { die shift };

Sigh, let's do it that way then.

> A *bit* cleaner is to use Carp::croak:

>     use Carp;
>     local $SIG{__WARN__} = \&croak;

Just as soon not add a new module dependency if we don't have to.
In this case, since we're not really expecting the warnings to get
thrown, it seems like there'd be little value added by doing so.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: pg_upgrade broken by xlog numbering
Следующее
От: Ryan Kelly
Дата:
Сообщение: Re: warning handling in Perl scripts