From: Eric Wong Date: Tue, 29 Apr 2025 20:47:44 +0000 (+0000) Subject: spawn: avoid string eval for optional Inline::C X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ebb013c5e47590286bd24747cb1f2565d30b422;p=thirdparty%2Fpublic-inbox.git spawn: avoid string eval for optional Inline::C String eval prevents error detection via `perl -c' syntax checks, so avoid it by trading `use' in favor of `require' + `->import'. --- diff --git a/lib/PublicInbox/Spawn.pm b/lib/PublicInbox/Spawn.pm index f79623b72..c832db591 100644 --- a/lib/PublicInbox/Spawn.pm +++ b/lib/PublicInbox/Spawn.pm @@ -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);