in reply to Using IPC::Open3 instead of backtick operator

The core module IO::Pipe is easy to use and works on both Linux and MS Windows. However, it doesn't handle STDERR.

The reader and writer methods expect a program to run and a list of arguments. The shell is not used.

#!perl use strict; use warnings; use IO::Pipe; my $pipe = IO::Pipe->new(); $pipe->reader(qw(ls -l)); while(<$pipe>) { ... }

Replies are listed 'Best First'.
Re^2: Using IPC::Open3 instead of backtick operator
by ikegami (Patriarch) on Jun 10, 2016 at 15:57 UTC

    This is the equivalent of doing no warnings;. It simply silences the message without addressing the issue (preventing error log from being filled with child's STDERR output). If your goal is simply to circumvent perlcritic, it provides far better ways of doing that.

      True. Is basically a somewhat safer way to accomplish what qx or backticks do.

      My answer was more for completeness.