]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
spawn: avoid string eval for optional Inline::C
authorEric Wong <e@80x24.org>
Tue, 29 Apr 2025 20:47:44 +0000 (20:47 +0000)
committerEric Wong <e@80x24.org>
Thu, 1 May 2025 21:29:48 +0000 (21:29 +0000)
String eval prevents error detection via `perl -c' syntax
checks, so avoid it by trading `use' in favor of `require' +
`->import'.

lib/PublicInbox/Spawn.pm

index f79623b72d92e7ab2bdd338df8ab665d622131ed..c832db591bcd9786649ed8fa23f6b265c7a4c3f9 100644 (file)
@@ -318,7 +318,10 @@ EOM
                open STDERR, '>&', $fh;
                STDERR->autoflush(1);
                STDOUT->autoflush(1);
-               eval 'use Inline C => $all_libc, BUILD_NOISY => 1';
+               eval {
+                       require Inline;
+                       Inline->import(C => $all_libc, BUILD_NOISY => 1);
+               };
                my $err = $@;
                open(STDERR, '>&', $olderr);
                open(STDOUT, '>&', $oldout);