Re: What about Perl autodie?

Поиск
Список
Период
Сортировка
От Dagfinn Ilmari Mannsåker
Тема Re: What about Perl autodie?
Дата
Msg-id 87h6h3k79o.fsf@wibble.ilmari.org
обсуждение исходный текст
Ответ на Re: What about Perl autodie?  (Daniel Gustafsson <daniel@yesql.se>)
Ответы Re: What about Perl autodie?  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:

>> On 18 Mar 2024, at 07:27, Peter Eisentraut <peter@eisentraut.org> wrote:
>
>> After some pondering, I figured the exclude list is better.  
>
> Agreed.
>
>> So here is a squashed patch, also with a complete commit message.
>
> Looks good from a read-through.  It would have been nice to standardize on
> using one of "|| die" and "or die" consistently but that's clearly not for this
> body of work.

"or die" is generally the preferred form, since || has higher precedence
than comma, so it's easy to make mistakes if you don't parenthesise the
function args, like:

   open my $fh, '>', $filname || die "can't open $filename: $!";

which will only fail if $filename is falsy (i.e. undef, "", or "0").

- ilmari



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

Предыдущее
От: Jacob Champion
Дата:
Сообщение: Re: Support json_errdetail in FRONTEND builds
Следующее
От: Matthias van de Meent
Дата:
Сообщение: Re: Optimizing nbtree ScalarArrayOp execution, allowing multi-column ordered scans, skip scan