Re: warning handling in Perl scripts

Поиск
Список
Период
Сортировка
От Ryan Kelly
Тема Re: warning handling in Perl scripts
Дата
Msg-id 20120625161546.GB18559@llserver.lakeliving.com
обсуждение исходный текст
Ответ на Re: warning handling in Perl scripts  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, Jun 25, 2012 at 12:07:55PM -0400, Tom Lane wrote:
> "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.
Carp is core since Perl 5 [1994-10-17].

> 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
> 
> -- 
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

-Ryan Kelly


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: warning handling in Perl scripts
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Remove sanity test in XRecOffIsValid.