What about Perl autodie?

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: What about Perl autodie?
Date: 2024-02-07 14:05:16
Message-ID: 88b7d4f2-46d9-4cc7-b1f7-613c90f9a76a@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I came across the Perl autodie pragma
(https://perldoc.perl.org/autodie). This seems pretty useful; is this
something we can use? Any drawbacks? Any minimum Perl version?

Attached is a sample patch of the kind of thing I'd be interested in.
The existing error handling of file operations in Perl is pretty
cumbersome, and this would simplify that.

Btw., here is a sample error message from autodie:

Can't open '../src/include/mb/pg_wchar.h' for reading: 'No such file or
directory' at ../src/include/catalog/../../backend/catalog/genbki.pl
line 391

which seems as good or better than the stuff we produce manually.

Attachment Content-Type Size
0001-WIP-Make-some-use-of-Perl-autodie-pragma.patch text/plain 4.1 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2024-02-07 14:14:40 Re: Commitfest 2024-01 first week update
Previous Message Amit Kapila 2024-02-07 13:51:53 Re: Commitfest 2024-01 first week update