Re: What about Perl autodie? - Mailing list pgsql-hackers

From Dagfinn Ilmari Mannsåker
Subject Re: What about Perl autodie?
Date
Msg-id 87h6h3k79o.fsf@wibble.ilmari.org
Whole thread Raw
In response to Re: What about Perl autodie?  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: What about Perl autodie?
List 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 by date:

Previous
From: Jacob Champion
Date:
Subject: Re: Support json_errdetail in FRONTEND builds
Next
From: Matthias van de Meent
Date:
Subject: Re: Optimizing nbtree ScalarArrayOp execution, allowing multi-column ordered scans, skip scan