Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1plFCO-0001mJ-2m for pgsql-committers@arkaria.postgresql.org; Sat, 08 Apr 2023 20:30:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1plFCM-0002fE-JX for pgsql-committers@arkaria.postgresql.org; Sat, 08 Apr 2023 20:30:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1plFCM-0002f5-CJ for pgsql-committers@lists.postgresql.org; Sat, 08 Apr 2023 20:30:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1plFCF-001hXT-At for pgsql-committers@lists.postgresql.org; Sat, 08 Apr 2023 20:30:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 338KU0u73618406; Sat, 8 Apr 2023 16:30:00 -0400 From: Tom Lane To: Daniel Gustafsson cc: Andrew Dunstan , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Skip \password TAP test on old IPC::Run versions In-reply-to: <627E6024-7803-473C-91AF-E8D76C3D99E0@yesql.se> References: <6d880ea2-f8ca-f458-4dcd-a7a3e6d6cd7c@dunslane.net> <3588535.1680971029@sss.pgh.pa.us> <627E6024-7803-473C-91AF-E8D76C3D99E0@yesql.se> Comments: In-reply-to Daniel Gustafsson message dated "Sat, 08 Apr 2023 22:20:30 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3618404.1680985800.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 08 Apr 2023 16:30:00 -0400 Message-ID: <3618405.1680985800@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Gustafsson writes: > On 8 Apr 2023, at 18:23, Tom Lane wrote: >> Can't we write "use IPC::Run 0.98;" and let >> some other code manage the version comparison? > We can, but that AFAIK (Andrew might have a better answer) requires the = below > diff which I think leaves some readability to be desired: > - (eval { require IO::Pty; } && eval { $IPC::Run::VERSION >=3D '0.98' = }); > + (eval { require IO::Pty; } && !!eval { IPC::Run->VERSION('0.98'); 1 = }); Maybe I'm missing something, but I was envisioning eval { require IO::Pty; use IPC::Run 0.98; } with no need to do more than check if the eval traps an error. regards, tom lane