- use PublicInbox::Spawn qw(which);
- if (eval { require IPC::Run } && which('w3m')) {
- require File::Temp;
- my $cmd = [ qw(w3m -T text/html -dump -config /dev/null) ];
- my ($out, $err) = ('', '');
-
- # workaround https://bugs.debian.org/927409
- $$ref =~ s/'/'/sg;
-
- IPC::Run::run($cmd, \('<pre>'.$$ref.'</pre>'), \$out, \$err);
+ SKIP: {
+ my $w3m = which('w3m') or
+ skip('w3m(1) missing to check output', 1);
+ my $cmd = [ $w3m, qw(-T text/html -dump -config /dev/null) ];
+ my $in = '<pre>' . $$ref . '</pre>';
+ my $out = xqx($cmd, undef, { 0 => \$in });