From de88c4a4443eae433f17c717af26c987cdbcaac4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 17 Oct 2023 23:37:53 +0000 Subject: xap_helper*: use autodie in more places This ought to lower the cognitive overhead of reading our code. --- lib/PublicInbox/XapHelperCxx.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/XapHelperCxx.pm') diff --git a/lib/PublicInbox/XapHelperCxx.pm b/lib/PublicInbox/XapHelperCxx.pm index 83015379..bd616b6f 100644 --- a/lib/PublicInbox/XapHelperCxx.pm +++ b/lib/PublicInbox/XapHelperCxx.pm @@ -29,12 +29,13 @@ my $xflags = ($ENV{CXXFLAGS} // '-Wall -ggdb3 -O0') . ' ' . my $xap_modversion; sub xap_cfg (@) { - open my $err, '+>', undef or die "open(undef): $!"; + use autodie qw(open seek); + open my $err, '+>', undef; my $cmd = [ $ENV{PKG_CONFIG} // 'pkg-config', @_, 'xapian-core' ]; my $rd = popen_rd($cmd, undef, { 2 => $err }); chomp(my $ret = do { local $/; <$rd> }); return $ret if close($rd); - seek($err, 0, SEEK_SET) or die "seek: $!"; + seek($err, 0, SEEK_SET); $err = read_all($err); die <