> On 18 Mar 2024, at 14:18, Dagfinn Ilmari Mannsåker <ilm...@ilmari.org> wrote:
> Daniel Gustafsson <dan...@yesql.se> writes:

>> 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").

Thanks for the clarification!  Looking over the || die() codepaths we have, and
we'll add as part of this patchset, none are vulnerable to the above issue
AFAICT.

--
Daniel Gustafsson



Reply via email to