- my ($out, $err) = ('', '');
-
- # workaround https://bugs.debian.org/927409
- $$ref =~ s/'/'/sg;
-
- IPC::Run::run($cmd, \('<pre>'.$$ref.'</pre>'), \$out, \$err);
+ open my $in, '+>', undef or die;
+ open my $out, '+>', undef or die;
+ my $rdr = { 0 => fileno($in), 1 => fileno($out) };
+ $in->autoflush(1);
+ print $in '<pre>', $$ref, '</pre>' or die;
+ $in->seek(0, SEEK_SET) or die;
+ my $pid = spawn($cmd, undef, $rdr);
+ waitpid($pid, 0);