Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Using IPC::Open3 instead of backtick operator

by RonW (Parson)
on Jun 09, 2016 at 16:26 UTC ( [id://1165238]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1165238]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-25 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found